Forráskód Böngészése

电池初始化调整,关闭调试

lvjincheng 4 éve
szülő
commit
eb9366749b

+ 5 - 5
Assets/BowArrow/Scenes/Home.unity

@@ -311,7 +311,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 8.361291, y: 0}
+  m_AnchoredPosition: {x: 0, y: 0}
   m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &219397737
@@ -693,7 +693,7 @@ RectTransform:
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
   m_AnchoredPosition: {x: 60, y: -35}
-  m_SizeDelta: {x: 0, y: 0}
+  m_SizeDelta: {x: 145.61469, y: 21.920488}
   m_Pivot: {x: 0, y: 1}
 --- !u!114 &551154240
 MonoBehaviour:
@@ -2101,7 +2101,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 95.08387, y: 0}
+  m_AnchoredPosition: {x: 0, y: 0}
   m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &1698308730
@@ -2795,7 +2795,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!114 &2012199174
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -4358,7 +4358,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 55.74194, y: 0}
+  m_AnchoredPosition: {x: 0, y: 0}
   m_SizeDelta: {x: 0, y: 40}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!1 &2473343858706513567

+ 3 - 3
Assets/BowArrow/Scripts/Bluetooth/BluetoothAim.cs

@@ -124,11 +124,11 @@ public class BluetoothAim : MonoBehaviour
                         }
                     }
                 }
-                CallDelay(1, delegate() {
+                CallDelay(1, OpenInfrared);
+                CallDelay(2, OpenReceiveData);
+                CallDelay(3, delegate() {
                     WriteData(SceneManager.GetActiveScene().name == "Game" ? "b" :"B");
                 });
-                CallDelay(2, OpenInfrared);
-                CallDelay(3, OpenReceiveData);
             };
             bluetoothHelper.OnConnectionFailed += (BluetoothHelper helper) =>
             {

+ 1 - 1
Assets/BowArrow/Scripts/Bluetooth/BluetoothHolder.cs

@@ -5,7 +5,7 @@ using UnityEngine.UI;
 
 public class BluetoothHolder : MonoBehaviour
 {   
-    bool debug = true;
+    bool debug = false;
     GameObject magEllipse;
     HashSet<Object> magEllipseViewers = new HashSet<Object>();
     public static BluetoothHolder ins;

+ 5 - 5
Assets/BowArrow/Scripts/View/DeviceBatteryView.cs

@@ -50,7 +50,7 @@ public class DeviceBatteryView : MonoBehaviour
     void RequestBatteryForBow()
     {
         try {
-            if (BluetoothAim.ins.hasData && JCUtil.GetTimestamp() - BluetoothAim.ins.hasDataTime > 5000) {
+            if (BluetoothAim.ins.hasData && JCUtil.GetTimestamp() - BluetoothAim.ins.hasDataTime > 3000) {
                 BluetoothAim.ins.WriteData(SceneManager.GetActiveScene().name == "Game" ? "b" :"B");
             }
         } catch (Exception) {}
@@ -65,15 +65,15 @@ public class DeviceBatteryView : MonoBehaviour
         } catch (Exception) {}
     }
 
-    public void RenderBattery(int deviceID, float value)
+    public void RenderBattery(int deviceID, int value)
     {
         bool active = true;
-        if (value == 0) active = false;
+        if (value <= 1) active = false;
         Image img = this.transform.Find($"Layout/Frame{deviceID}/Bar").GetComponent<Image>();
-        Text txt =this.transform.Find($"Layout/Frame{deviceID}/Value").GetComponent<Text>();
+        Text txt = this.transform.Find($"Layout/Frame{deviceID}/Value").GetComponent<Text>();
         this.transform.Find($"Layout/Label{deviceID}").gameObject.SetActive(active);
         img.transform.parent.gameObject.SetActive(active);
         img.fillAmount = value / 100f;
-        txt.text = ((int) value) + "%";
+        txt.text = value + "%";
     }
 }