Bladeren bron

融合士兵不算在献祭使魔数量内

wgl 7 maanden geleden
bovenliggende
commit
175ab7fd4f
1 gewijzigde bestanden met toevoegingen van 8 en 9 verwijderingen
  1. 8 9
      ActionTowerDefense/Assets/Scripts/Characters/PlayerController.cs

+ 8 - 9
ActionTowerDefense/Assets/Scripts/Characters/PlayerController.cs

@@ -134,10 +134,7 @@ public class PlayerController : MoveCharacter
     public GameObject[] cannotConductFXs;
     public List<GameObject> demonicPrefabs;
     public List<Vector3> demonicSummonPos;
-    public Dictionary<int, List<Demonic>> demonicDic;
-    private List<Demonic> arrows = new List<Demonic>();
-    private List<Demonic> giants = new List<Demonic>();
-    private List<Demonic> swords = new List<Demonic>();
+    public Dictionary<int, List<Demonic>> demonicDic;   //0:弓兵,1:胖子,2:棒子,3:融合后的弓兵,4:融合后的胖子,5:融合后的棒子
 
     [Header("攻击")]
     public PlayerAttackState attackState;
@@ -455,7 +452,7 @@ public class PlayerController : MoveCharacter
         }
         skeletonMecanim.skeletonDataAsset = playerSpine[playerId];
         demonicDic = new Dictionary<int, List<Demonic>>();
-        for (int i = 0; i < 3; i++)
+        for (int i = 0; i < 5; i++)
         {
             demonicDic.Add(i, new List<Demonic>());
         }
@@ -827,9 +824,12 @@ public class PlayerController : MoveCharacter
                     GameObject demonicObj = PoolManager.Instantiate(bigGiant[cacheConductId]);
                     demonicObj.SetActive(false);
                     BigSoldier bs = demonicObj.GetComponent<BigSoldier>();
-                    bs.id = cacheConductId;
+                    bs.id = cacheConductId + 3;
                     demonicDic[bs.id].Add(bs);
-                    demonicNums[bs.id].text = demonicDic[bs.id].Count.ToString();                   
+                    if(bs.id < 3)
+                    {
+                        demonicNums[bs.id].text = demonicDic[bs.id].Count.ToString();
+                    }       
                     int tempthp = boostNum * temptHp;
                     bs.playerID = playerId;
                     demonicObj.transform.parent = null;
@@ -886,8 +886,7 @@ public class PlayerController : MoveCharacter
                             d.attackController.addAttackEffect.transform.GetChild(0).gameObject.SetActive(true);
                         }
                     }
-                    giants = newGiants;
-                    foreach (Demonic d in giants)
+                    foreach (Demonic d in newGiants)
                     {
                         int[] damages = d.attackController.curDamage2;
                         for (int i = 0; i < damages.Length; i++)