Răsfoiți Sursa

变身刺客二段冲刺

LAPTOP-OM1V99U2\永远de小亡灵 1 an în urmă
părinte
comite
8d0a8314da

+ 1 - 0
ActionTowerDefense/Assets/Resources/Prefab/Transfiguration/Trans_Assassin.prefab

@@ -202,6 +202,7 @@ MonoBehaviour:
   dashEffect: {fileID: 4435902830102402973}
   targetDir: {x: 0, y: 0, z: 0}
   time: 0
+  nextRushTime: 1
 --- !u!114 &2437299196472462353
 MonoBehaviour:
   m_ObjectHideFlags: 0

+ 13 - 2
ActionTowerDefense/Assets/Scripts/Spirits/Spirits_Dash.cs

@@ -41,13 +41,24 @@ public class Spirits_Dash : MonoBehaviour
     }
     private void Dash()
     {
-        if (demonic.bodyTrans.localScale.x < 0)
+        if (demonic.player.bodyTrans.localScale.x < 0)
         {
+            if (demonic.bodyTrans.localScale.x > 0)
+            {
+                demonic.bodyTrans.localScale = new Vector3(-demonic.bodyTrans.localScale.x,
+                   demonic.bodyTrans.localScale.y, demonic.bodyTrans.localScale.z);
+            }
             rb.velocity = Vector3.right * moveSpeed;
             dashEffect.offset = offset;
         }
-        if (demonic.bodyTrans.localScale.x > 0)
+        if (demonic.player.bodyTrans.localScale.x > 0)
         {
+            if(demonic.bodyTrans.localScale.x < 0)
+            {
+                demonic.bodyTrans.localScale = new Vector3(-demonic.bodyTrans.localScale.x,
+                   demonic.bodyTrans.localScale.y, demonic.bodyTrans.localScale.z);
+            }
+            
             rb.velocity = Vector3.left * moveSpeed;
             dashEffect.offset = -offset;
         }

+ 59 - 1
ActionTowerDefense/Assets/Scripts/Spirits/Trans_Assassin.cs

@@ -25,6 +25,7 @@ public class Trans_Assassin : MonoBehaviour
     public Vector3 targetDir;
     [HideInInspector]
     public float time;
+    public float nextRushTime;
 
     // Start is called before the first frame update
     void Start()
@@ -42,6 +43,63 @@ public class Trans_Assassin : MonoBehaviour
         if (isNextUltimate)
         {
 
+            if (isUltimate)
+            {
+
+                if (player.isUltimate)
+                {
+                    ReadyToDash(player.moveVec);
+                }
+                else
+                {
+                    dashEffect.canHit = true;
+                    aimEffect.SetActive(false);
+                    player.ani.Play("attack_summon", 0, 0);
+                    Rush();
+                    time += Time.deltaTime;
+                    if (time >= rushTime)
+                    {
+                        //isNextUltimate = true;
+                        //isUltimate = false;
+                        
+                        player.canMove = true;
+                        player.canfly = false;
+                        dashEffect.canHit = false;
+                        player.bodyTrans.rotation = Quaternion.Euler(Vector3.zero);
+                        player.ChangeState(CharacterState.Fall);
+                        time = 0;
+                        player.EndTransfiguration(4);
+                    }
+                }
+            }
+            else
+            {
+                time += Time.deltaTime;
+                if (time >= nextRushTime)
+                {
+                    player.EndTransfiguration(4);
+                }
+                if (player.isUltimate)
+                {
+                    time = 0;
+                    player.moveVec = player.leftDir;
+                    player.canMove = false;
+                    player.ChangeState(CharacterState.None);
+                    player.ani.Play("charge", 0, 0);
+                    player.canfly = true;
+                    if (!player.foot.TrigGround)
+                    {
+
+                        player.rb.velocity = Vector3.zero;
+                        player.rb.useGravity = false;
+                    }
+                    aimEffect.SetActive(true);
+                    aimEffect.transform.localScale =
+                        new Vector3(distance, 3, 1);
+                    isUltimate = true;
+
+                }
+            }
         }
         else
         {
@@ -61,7 +119,7 @@ public class Trans_Assassin : MonoBehaviour
                     time += Time.deltaTime;
                     if (time >= rushTime)
                     {
-                        //isNextUltimate = true;
+                        isNextUltimate = true;
                         isUltimate = false;
                         player.canMove = true;
                         player.canfly = false;