Quellcode durchsuchen

兔子移动范围修改

lvjincheng vor 4 Jahren
Ursprung
Commit
3c228b9110

+ 1 - 1
Assets/BowArrow/Scenes/GameChallengeScene/Rabbit.cs

@@ -234,7 +234,7 @@ public class Rabbit : TargetAnimal
     void RandomMove() {
         Vector3 standardPointer = animalsBaseT.forward;
         Vector3 pointerWithLen = standardPointer.normalized * (baseDistance + Random.value * baseDistanceMoveRange);
-        pointerWithLen = Quaternion.AngleAxis(-30f + Random.value * 60f, Vector3.up) * pointerWithLen;
+        pointerWithLen = Quaternion.AngleAxis(Random.Range(-22f, 22f), Vector3.up) * pointerWithLen;
         Vector3 newPos = animalsBaseT.position + pointerWithLen;
         // GameObject.Find("BBAA").transform.position = newPos;
         // GameObject.Find("BBBA").transform.LookAt(GameObject.Find("BBAA").transform);

+ 1 - 1
Assets/BowArrow/Scenes/GameChallengeScene/RabbitHuntGameMode.cs

@@ -68,7 +68,7 @@ public class RabbitHuntGameMode : ChallengeGameMode
             baseCreateDistance += plusCreateDistance;
             Vector3 standardPointer = animalsBaseT.forward;
             Vector3 displace = standardPointer * createDistance;
-            displace = Quaternion.AngleAxis(30 - Random.value * 60, Vector3.up) * displace;
+            displace = Quaternion.AngleAxis(Random.Range(-22f, 22f), Vector3.up) * displace;
             Vector3 newPos = animalsBaseT.position + displace;
         #endregion
 

+ 2 - 1
Assets/BowArrow/Scripts/Manager/GameMgr.cs

@@ -8,7 +8,7 @@ using UnityEngine.SceneManagement;
 public class GameMgr : MonoBehaviour
 {
     public static bool debugInEditor = false;
-    public static int gameType = 4;
+    public static int gameType = 6;
     public GameMode gameMode;
     [System.NonSerialized] public bool gameOver = false;
     public static GameMgr ins;
@@ -59,6 +59,7 @@ public class GameMgr : MonoBehaviour
         if (gameType == 3) gameMode = new RabbitHuntGameMode(this);
         if (gameType == 4) gameMode = new YejiHuntGameMode(this);
         if (gameType == 5) gameMode = new WolfHuntGameMode(this);
+        if (gameType == 6) gameMode = new RabbitHuntGameMode_LocalPK(this);
     }
 
     public void StopGame() {