Jelajahi Sumber

调试+鸟问题修复

lvjincheng 4 tahun lalu
induk
melakukan
0ac2a72307

+ 1 - 1
Assets/ArtAsset/Hunter/Models/Yeji/Yeji.fbx.meta

@@ -212,7 +212,7 @@ ModelImporter:
       cycleOffset: 0
       loop: 0
       hasAdditiveReferencePose: 0
-      loopTime: 0
+      loopTime: 1
       loopBlend: 0
       loopBlendOrientation: 0
       loopBlendPositionY: 0

+ 6 - 7
Assets/BowArrow/Scenes/GameChallengeScene/GameChallenge.unity

@@ -7318,7 +7318,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0.5}
   m_AnchorMax: {x: 0, y: 0.5}
-  m_AnchoredPosition: {x: 0, y: -227}
+  m_AnchoredPosition: {x: 0, y: -259}
   m_SizeDelta: {x: 160, y: 40}
   m_Pivot: {x: 0, y: 0.5}
 --- !u!114 &329851118
@@ -20774,7 +20774,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: 28.626865, y: 0}
+  m_AnchoredPosition: {x: 28.854338, y: 0}
   m_SizeDelta: {x: 0, y: 33}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &1047161075
@@ -24095,7 +24095,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: 28.626865, y: 0}
+  m_AnchoredPosition: {x: 28.854338, y: 0}
   m_SizeDelta: {x: 0, y: 33}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &1203594963
@@ -29310,7 +29310,6 @@ MonoBehaviour:
   outlight: {fileID: 2100000, guid: 502f08d2109aaeb4d92b1b552bfed15c, type: 2}
   text1: {fileID: 1107490634}
   text2: {fileID: 2001817781}
-  shootScaleValue: 1
 --- !u!1 &1471221715 stripped
 GameObject:
   m_CorrespondingSourceObject: {fileID: 104774, guid: 196a6be01d89f9840bebaad593a4bf7f, type: 3}
@@ -39520,8 +39519,8 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0.5}
   m_AnchorMax: {x: 0, y: 0.5}
-  m_AnchoredPosition: {x: 0, y: -57}
-  m_SizeDelta: {x: 400, y: 300}
+  m_AnchoredPosition: {x: 0, y: -40}
+  m_SizeDelta: {x: 400, y: 400}
   m_Pivot: {x: 0, y: 0.5}
 --- !u!114 &1996910846
 MonoBehaviour:
@@ -42363,7 +42362,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: 47.25373, y: 0}
+  m_AnchoredPosition: {x: 47.708675, y: 0}
   m_SizeDelta: {x: 0, y: 33}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &2142579590

+ 6 - 7
Assets/BowArrow/Scenes/GameChallengeScene/Yeji.cs

@@ -14,7 +14,9 @@ public class Yeji : TargetAnimal
     [System.NonSerialized] public TreeAreaRecorder treeAreaRecorder;
     [System.NonSerialized] public float flyPlaneHeight = 5;
     float currentHeight = 0;
+    float toFlyHeight = float.NaN;
     public void SetFlyHeight(float value) {
+        if (toFlyHeight.Equals(float.NaN)) toFlyHeight = value;
         currentHeight = value;
         float agentBaseOffset = value - flyPlaneHeight;
         this.agent.baseOffset = agentBaseOffset / 1.2f;//因为agent的baseoffset会受节点的scale影响
@@ -146,7 +148,6 @@ public class Yeji : TargetAnimal
             UpdateBehavior();
         }
         
-        float toFlyHeight = 2f;
         float canStandTime = 3f;
         float canFlyStayTime = 3f;
         //能够在前几棵树徘徊
@@ -251,7 +252,7 @@ public class Yeji : TargetAnimal
             if (willStayOnTree) {
                 willStayOnTree = false;
                 state.flyStaying = true;
-                canFlyStayTime = 4f + Random.value * 2f;
+                canFlyStayTime = 9f + Random.value * 1f;
                 return;
             }
 
@@ -315,15 +316,13 @@ public class Yeji : TargetAnimal
             preFlyHeightCools = new object[]{null, null};
         }
         public static float RandomOnePreHeight(Yeji yeji) {
-            List<int> indexes = new List<int>();
             for (int i = 0; i < preFlyHeightCools.Length; i++) {
                 if (preFlyHeightCools[i] == null) {
-                    indexes.Add(i);
+                    preFlyHeightCools[i] = yeji;
+                    return preFlyHeights[i];
                 }
             }
-            int index = indexes[Random.Range(0, indexes.Count)];
-            preFlyHeightCools[index] = yeji;
-            return preFlyHeights[index];
+            return 2.5f;
         }
         public static void ReleasePreHeight(Yeji yeji) {
             for (int i = 0; i < preFlyHeightCools.Length; i++) {

+ 11 - 1
Assets/BowArrow/Scripts/Game/Arrow.cs

@@ -56,24 +56,34 @@ public class Arrow : MonoBehaviour
             ArrowDebugView.ins?.AppendLog("bt2:" + ShootCheck.ins.byteTime2);
         }
         mySpeed = speed;
+        ArrowDebugView.ins?.AppendLog("Bill-start");
         Billboard.ins?.SetArrowSpeed(speed);
         if (GameAssistUI.ins) {
+            ArrowDebugView.ins?.AppendLog("Bill-process-s");
             mySpeed *= GameAssistUI.ins.shootScaleValue;
             Billboard.ins?.SetArrowSpeedScale(GameAssistUI.ins.shootScaleValue);
+            ArrowDebugView.ins?.AppendLog("Bill-process-e");
         }
         Billboard.ins?.ShowSpeed();
-
+        ArrowDebugView.ins?.AppendLog("Bill-end");
         if (absoluteRay.transform) {
+            ArrowDebugView.ins?.AppendLog("red-circle-incheck");
+            ArrowDebugView.ins?.AppendLog("ray-hit-name: " + absoluteRay.transform.gameObject.name);
             //记录射线有没有击中靶子
             rayHitTargetBody = absoluteRay.transform.GetComponent<TargetBody>();
+            ArrowDebugView.ins?.AppendLog("tb-get-success");
             //把瞄准点画成红圈,渲染在靶子上
             if (rayHitTargetBody) {
+                ArrowDebugView.ins?.AppendLog("red-circle-check-ok");
                 Transform redCircle = rayHitTargetBody.transform.Find("RedCircle");
                 redCircle.gameObject.SetActive(true);
                 redCircle.transform.position = -redCircle.transform.forward * 0.001f + absoluteRay.point;
+                ArrowDebugView.ins?.AppendLog("red-circle-check-ok-end");
             }
         }
+        ArrowDebugView.ins?.AppendLog("setUpBeforeFly-start");
         SetUpBeforFly();
+        ArrowDebugView.ins?.AppendLog("setUpBeforeFly-end");
         ArrowDebugView.ins?.AppendLog("F:" + finalPoint);
         ArrowDebugView.ins?.AppendLog("FAR:" + parabolaAngleInRadian);