| 12345678910111213141516171819202122232425262728293031323334353637 |
- 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.blue);
- return (15, new Color(255f / 255f, 165f / 255f, 0));
- } else if (status == BluetoothStatusEnum.ConnectSuccess) {
- //return (16, Color.new Color32(255,215,0,0));
- return (16, new Color(255f / 255f, 215f / 255f, 0));
- } 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
- }
|