lvjincheng 4 anni fa
parent
commit
f114e6f2b9

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

@@ -487,7 +487,7 @@ class AimHandler
         {
             Quaternion nowRotation = controlObj.localRotation;
             filter.Update(ref nowRotation, newRotation);
-            controlObj.localRotation = nowRotation;
+            controlObj.localRotation = Quaternion.Lerp(controlObj.localRotation, nowRotation, Time.deltaTime * 6);
             // GameObject.Find("Canvas/RPY_LOG").GetComponent<Text>().text = 
             //     "roll: " + controlObj.localEulerAngles.x +
             //     "\npitch: " + controlObj.localEulerAngles.y +

+ 2 - 2
Assets/BowArrow/Scripts/Game/ArmBow.cs

@@ -111,7 +111,7 @@ public class ArmBow : MonoBehaviour
     }
 
     public void shoot() {
-        Vector3 rayHitPoint = CrossHair.ins.getRayHitPoint();
+        // Vector3 rayHitPoint = CrossHair.ins.getRayHitPoint();
 
         GameObject arrowCopy = GameObject.Instantiate(this.arrow, this.bowCamera.transform.position, this.bowCamera.transform.rotation);
 
@@ -119,7 +119,7 @@ public class ArmBow : MonoBehaviour
         Vector3 s2 = bowCamera.transform.localScale;
         arrowCopy.transform.localScale = new Vector3(s1.x * s2.x, s1.y * s2.y, s1.z * s2.z);
 
-        arrowCopy.transform.LookAt(rayHitPoint);
+        // arrowCopy.transform.LookAt(rayHitPoint);
 
         Arrow arrowComp = arrowCopy.AddComponent<Arrow>();
         arrowComp.armBow = this;