Prechádzať zdrojové kódy

飞剑角度入射角可调

LAPTOP-OM1V99U2\永远de小亡灵 10 mesiacov pred
rodič
commit
61b66da5c4

+ 3 - 2
ActionTowerDefense/Assets/Scripts/Conduct/FanFlyingSwords.cs

@@ -7,6 +7,7 @@ public class FanFlyingSwords : MonoBehaviour
     public GameObject sword;
     public PlayerController owner;
     public float angleRange;
+    public float arrivalAngle;
     public int swordsNum;
     [Header("É˺¦")]public int damage;
     // Start is called before the first frame update
@@ -20,11 +21,11 @@ public class FanFlyingSwords : MonoBehaviour
             Vector3 dir = Vector3.zero;
             if(owner.bodyTrans.localScale.x > 0)
             {
-                angle = 180 - angleRange/2 + i * angleInterval;
+                angle = 180 - arrivalAngle - angleRange/2 + i * angleInterval;
             }
             else
             {
-                angle = -angleRange / 2 + i * angleInterval;
+                angle = arrivalAngle -angleRange / 2 + i * angleInterval;
 
             }
             angle = angle / 180 * Mathf.PI;

+ 2 - 0
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -192,6 +192,7 @@ public class PlayerController : MoveCharacter
     //ÉÈÐηɽ£
     public GameObject fanFlyingSwords;
     [Header("·É½£½Ç¶È·¶Î§")]public float flyingSwordsAngleRange;
+    [Header("·É½£½Ç¶ÈÈëÉä½Ç")] public float flyintSwordsArrivalAngle;
 
     public enum ConductSkills
     {
@@ -913,6 +914,7 @@ public class PlayerController : MoveCharacter
                         FanFlyingSwords FFS = obj.GetComponent<FanFlyingSwords>();
                         FFS.owner = this;
                         FFS.angleRange = flyingSwordsAngleRange;
+                        FFS.arrivalAngle = flyintSwordsArrivalAngle;
                         FFS.swordsNum = demonicDic[0].Count * 7;
                         FFS.Biu();
                     }