using Assets.Scripts.Devices.Ant; using System.Collections; using System.Collections.Generic; using System; using System.Linq; using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; using UnityEngine.Events; using Assets.Scripts.Devices.Ant.Interfaces; using Assets.Scripts.UI.UIEffect; using Assets.Scripts; using DG.Tweening; using Assets.Scripts.UI.Prefab.Device; using Assets.Scripts.Devices; using Assets.Scripts.Devices.Ble; public class DeviceView : MonoBehaviour { [SerializeField] private SensorType mType; private SensorType SensorType { get { //Debug.Log(mType); //Enum.TryParse(mType, out SensorType sensorType); return mType; } } private GameObject mSearchButton; private GameObject mPairButton; private GameObject mDisconnectButton; private GameObject unconnectionPanel; private GameObject connectionPanel; private Text searchState; private ConnectDeviceModal deviceModal; private Text title; private Text noDevice; private Text powerValue; private Text powerUnit; //private Text cadenceValue; //private Text speedValue; //private Text heartRateValue; private Image logo; /// /// 没有设备的logo /// private Sprite sprite0; /// /// 连接中的logo /// private Sprite sprite1; /// /// 已连接的logo /// private Sprite sprite3; private Button unconnectionButton; private Button connectionButton; private float timer = 1.0f; private void Awake() { title = this.transform.Find("Title").GetComponent(); noDevice = this.transform.Find("NoDevice").GetComponent(); unconnectionPanel = this.transform.Find("UnconnectionPanel").gameObject; mSearchButton = unconnectionPanel.transform.Find("SearchButton").gameObject; mPairButton = unconnectionPanel.transform.Find("PairButton").gameObject; searchState = unconnectionPanel.transform.Find("SearchState").GetComponent(); //mPairButton.SetActive(false); connectionPanel = this.transform.Find("ConnectionPanel").gameObject; #if UNITY_IOS || UNITY_ANDROID unconnectionButton = unconnectionPanel.GetComponent