| 1234567891011121314151617181920212223242526272829303132333435 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class BluetoothStatus
- {
- // return textID, Color
- public static (int, Color) GetStatusInfo(BluetoothStatusEnum status)
- {
- if (status == BluetoothStatusEnum.Connecting) {
- return (15, Color.yellow);
- } else if (status == BluetoothStatusEnum.ConnectSuccess) {
- return (16, Color.green);
- } else if (status == BluetoothStatusEnum.ConnectFail) {
- return (17, Color.red);
- }
- return (14, Color.white);
- }
- public static bool IsAllConnected()
- {
- if (!BluetoothAim.ins || !BluetoothShoot.ins) return false;
- return BluetoothAim.ins.status == BluetoothStatusEnum.ConnectSuccess &&
- BluetoothShoot.ins.status == BluetoothStatusEnum.ConnectSuccess;
- }
- }
- public enum BluetoothStatusEnum
- {
- None,
- Connect,
- Connecting,
- ConnectSuccess,
- ConnectFail
- }
|