Ver Fonte

变身后可召唤兵,再按一次变身键解除变身并召唤该英灵

SZAND\msx_2 há 1 ano atrás
pai
commit
c61c8bd826
1 ficheiros alterados com 40 adições e 20 exclusões
  1. 40 20
      ActionTowerDefense/Assets/Scripts/PlayerController.cs

+ 40 - 20
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -415,38 +415,62 @@ public class PlayerController : MoveCharacter
     }
     void OnSummonSpirit()
     {
-        if (!isTransfiguration && !isFloat && canMove)
-            isSpiritSummon = true;
-        if (isTransfiguration && currentSpirit == 0)
+        if (!isFloat && canMove)
         {
-            
+            if (!isTransfiguration)
+            {
+                isSpiritSummon = true;
+            }
+            else if(currentSpirit == 0)
+            {
+                //释放技能,此处暂时先写解除变身
+                EndTransfiguration(endChange);
+            }
         }
     }
     void OnSummonSpirit1()
     {
-        if (!isTransfiguration && !isFloat && canMove)
-            isSpiritSummon1 = true;
-        if (isTransfiguration && currentSpirit == 1)
+        if (!isFloat && canMove)
         {
-            
+            if (!isTransfiguration)
+            {
+                isSpiritSummon1 = true;
+            }
+            else if(currentSpirit == 1)
+            {
+                //释放技能,此处暂时先写解除变身
+                EndTransfiguration(endChange);
+            }
         }
     }
     void OnSummonSpirit2()
     {
-        if (!isTransfiguration && !isFloat && canMove)
-            isSpiritSummon2 = true;
-        if (isTransfiguration && currentSpirit == 2)
+        if (!isFloat && canMove)
         {
-            
+            if (!isTransfiguration)
+            {
+                isSpiritSummon2 = true;
+            }
+            else if(currentSpirit == 2)
+            {
+                //释放技能,此处暂时先写解除变身
+                EndTransfiguration(endChange);
+            }
         }
     }
     void OnSummonSpirit3()
     {
-        if (!isTransfiguration && !isFloat && canMove)
-            isSpiritSummon3 = true;
-        if (isTransfiguration && currentSpirit == 3)
+        if (!isFloat && canMove)
         {
-            
+            if (!isTransfiguration)
+            {
+                isSpiritSummon3 = true;
+            }
+            else if(currentSpirit == 3)
+            {
+                //释放技能,此处暂时先写解除变身
+                EndTransfiguration(endChange);
+            }
         }
     }
     public void Jump()
@@ -473,10 +497,6 @@ public class PlayerController : MoveCharacter
 
     public bool CheckSummon()
     {
-        if (isTransfiguration)
-        {
-            return false;
-        }
         if (cacheSummonTime > 0)
         {
             Summon(cacheSummonId);