瀏覽代碼

胖子召唤大小有变化(参数可调)

SZAND\msx_2 10 月之前
父節點
當前提交
54b3a9289d

+ 7 - 1
ActionTowerDefense/Assets/Resources/Prefab/Player.prefab

@@ -1003,10 +1003,16 @@ MonoBehaviour:
   - 0
   - 0
   - 0
-  conductSkills: 000000000400000004000000
+  conductSkills: 000000000000000004000000
   conductCanRelease: 010101
   conductReadyTip: {fileID: 946637326309089849}
   bigGiant: {fileID: 5440846222648032759, guid: d64528a2dcc945b4a9ea5d5a859679f3, type: 3}
+  stageSize:
+  - 1.5
+  - 2
+  - 3
+  - 3.5
+  giantDieNum: 02000000030000000500000007000000
   photosphereObj: {fileID: 256012001268456902, guid: ba2e5bcb5c7ac604ea72b2fcb544a3cb, type: 3}
   addAttack: 0.2
   attackEffect: {fileID: 417478504669294145, guid: 3b9e1b8087a2c2441a51fff8fec35d4f, type: 3}

+ 21 - 1
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -171,6 +171,8 @@ public class PlayerController : MoveCharacter
     private bool isReadyConduct;
     //´óÅÖ×Ó
     public GameObject bigGiant;
+    public float[] stageSize;
+    public int[] giantDieNum;
     //¹âÇò
     public GameObject photosphereObj;
     //¹¥»÷Á¦
@@ -686,6 +688,23 @@ public class PlayerController : MoveCharacter
         return false;
     }
 
+    private float TranSize(int dieNum)
+    {
+        for (int i = stageSize.Length - 1; i >= 0; i--)
+        {
+            if (dieNum >= giantDieNum[i])
+            {
+                if (i == stageSize.Length - 1)
+                {
+                    return stageSize[i];
+                }
+                float size = stageSize[i] + (stageSize[i + 1] - stageSize[i]) / (giantDieNum[i + 1] - giantDieNum[i]) * (dieNum - giantDieNum[i]);
+                return size;
+            }
+        }
+        return 1;
+    }
+
     public void Conduct()
     {
         if (mp >= conductCostMp[cacheConductId])
@@ -697,6 +716,7 @@ public class PlayerController : MoveCharacter
                 case ConductSkills.Giant:
                     if (demonicDic[1].Count > 0)
                     {
+                        int dienum = demonicDic[1].Count;
                         int tempthp = giantNum * 1000;
                         foreach(Demonic d in giants)
                         {
@@ -710,7 +730,7 @@ public class PlayerController : MoveCharacter
                         demonic.playerID = playerId;
                         demonicObj.transform.parent = null;
                         demonicObj.transform.localEulerAngles = Vector3.zero;
-                        demonicObj.transform.localScale = new Vector3(2, 2, 2);
+                        demonicObj.transform.localScale = new Vector3(1, 1, 1) * TranSize(dienum);
                         Vector3 offset = demonicSummonPos[1] * 2;
                         if (bodyTrans.localScale.x > 0)
                         {