实现连接设备界面

This commit is contained in:
suntao committed 2021-04-01 11:09:53 +08:00
1 parent 996f924719
commit ec7589096f
88 files changed
+11344 -156

No files matched your search

@@ -20,11 +20,11 @@ public class DeviceController : PFUIPanel
protected override void Start()
{
base.Start();
Button button = this.transform.Find("Button").GetComponent<Button>();
button.onClick.AddListener(() =>
{
UIManager.ShowHomePanel();
});
//Button button = this.transform.Find("Button").GetComponent<Button>();
//button.onClick.AddListener(() =>
//{
// UIManager.ShowHomePanel();
//});
this.toggle = this.transform.Find("Toggle").GetComponent<Toggle>();
this.toggle.onValueChanged.AddListener(s =>
@@ -46,7 +46,7 @@ public class DeviceController : PFUIPanel
timer -= Time.deltaTime;
if (timer <= 0)
{
this.toggle.isOn = AntConnector.Instance().IsAvailable;
//this.toggle.isOn = AntConnector.Instance().IsAvailable;
//foreach (var item in AntConnector.Instance().discoveredDevices)
//{
@@ -64,4 +64,9 @@ public class DeviceController : PFUIPanel
timer = 1.0f;
}
}
private void OnApplicationQuit()
{
AntConnector.Instance().Dispose();
}
}
+11 -6
View File
@@ -9,12 +9,17 @@ using UnityEngine.EventSystems;
//namespace Assets.Scripts.UI.Prefab.Panel
//{
public class PFUIPanel : UIBehaviour
{
public class PFUIPanel : UIBehaviour
{
public void OpenURL(string url)
{
Application.OpenURL(url);
}
public void OpenURL(string url)
{
Application.OpenURL(url);
}
public virtual void Close()
{
DestroyImmediate(this.gameObject);
}
}
//}