android端发布前微调
This commit is contained in:
1 parent
d38330d969
commit
bd9696cd81
34 files changed
+859
-934
No files matched your search
@@ -53,7 +53,9 @@ public class ConnectDeviceModal : PFUIPanel
|
||||
deviceList = new Dictionary<string, DeviceItem>();
|
||||
|
||||
var container = this.transform.Find("GameObject");
|
||||
|
||||
deviceNotFound = container.Find("Panel/Error").gameObject;
|
||||
|
||||
var closeBtn = container.Find("CloseBtn");
|
||||
Logo = container.Find("Logo").GetComponent<Image>();
|
||||
Title = container.Find("Title").GetComponent<Text>();
|
||||
@@ -261,7 +263,9 @@ public class ConnectDeviceModal : PFUIPanel
|
||||
//如果没有可连接的设备按钮只读
|
||||
connectBtn.mButton.enabled = deviceList.Count > 0;
|
||||
connectBtn.mButton.interactable = deviceList.Count > 0;
|
||||
|
||||
deviceNotFound.SetActive(deviceList.Count <= 0);
|
||||
|
||||
}
|
||||
}
|
||||
//选中需要连接的设备
|
||||
|
||||
@@ -151,13 +151,43 @@ public class DeviceView : MonoBehaviour
|
||||
{
|
||||
return;
|
||||
}
|
||||
mDisconnectButtonClick();
|
||||
var device = GetDevice();
|
||||
if (device != null && device.State == DeviceState.Connected)
|
||||
{
|
||||
UIManager.ShowConfirm(App.GetLocalString("Warning"), App.GetLocalString("Disconnect the device?"), () =>
|
||||
{
|
||||
device.Disconnect(false);
|
||||
DeviceCache.Remove(device);
|
||||
UIManager.CloseConfirm();
|
||||
}, 2, () => {
|
||||
UIManager.CloseConfirm();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
mDisconnectButtonClick();
|
||||
}
|
||||
}));
|
||||
#endif
|
||||
|
||||
|
||||
UIManager.AddEvent(mDisconnectButton, EventTriggerType.PointerClick, new UnityEngine.Events.UnityAction<BaseEventData>(e => {
|
||||
#if UNITY_IOS || UNITY_ANDROID
|
||||
var device = GetDevice();
|
||||
if (device != null && device.State == DeviceState.Connected)
|
||||
{
|
||||
UIManager.ShowConfirm(App.GetLocalString("Warning"), App.GetLocalString("Disconnect the device?"), () =>
|
||||
{
|
||||
device.Disconnect(false);
|
||||
DeviceCache.Remove(device);
|
||||
UIManager.CloseConfirm();
|
||||
}, 2, () => {
|
||||
UIManager.CloseConfirm();
|
||||
});
|
||||
}
|
||||
#else
|
||||
mDisconnectButtonClick();
|
||||
#endif
|
||||
}));
|
||||
|
||||
}
|
||||
@@ -280,8 +310,6 @@ public class DeviceView : MonoBehaviour
|
||||
|
||||
logo.sprite = sprite0;
|
||||
|
||||
searchState.text = App.GetLocalString("Searching...");
|
||||
|
||||
var hasDevice = false;
|
||||
if (SensorType == SensorType.SpeedCadence) {
|
||||
hasDevice = App.MainDeviceAdapter.GetDevices().Any(d => d.Sensor == SensorType.SpeedCadence || d.Sensor == SensorType.Cadence);
|
||||
@@ -289,8 +317,10 @@ public class DeviceView : MonoBehaviour
|
||||
else {
|
||||
hasDevice = App.MainDeviceAdapter.GetDevices().Any(d => d.Sensor == SensorType);
|
||||
}
|
||||
noDevice.text = hasDevice? App.GetLocalString("CHOOSE DEVICE") : App.GetLocalString("NO DEVICE");
|
||||
//Debug.Log(hasDevice);
|
||||
|
||||
searchState.text = hasDevice ? App.GetLocalString("CHOOSE DEVICE") : App.GetLocalString("NO DEVICE");
|
||||
noDevice.text = "";// App.GetLocalString("NOCONN DEVICE"); //hasDevice ? App.GetLocalString("CHOOSE DEVICE") : ;
|
||||
|
||||
if (hasDevice)
|
||||
{
|
||||
mSearchButton.SetActive(false);
|
||||
|
||||
Reference in new issue
Block a user