Kaynağa Gözat

修改变身按键

SZAND\msx_2 1 yıl önce
ebeveyn
işleme
9a54fd395f

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

@@ -36,7 +36,7 @@ public class PlayerController : MoveCharacter
     //public static PlayerController instance;
     public List<GameObject> changePrefabs;
     private GameObject spiritObj;   //当前变身的对象
-    private int endChange = 0;
+    public int endChange = 0;
     //public float changeTime;        //变身时长
     //private float pastChangeTime;
 
@@ -464,6 +464,23 @@ public class PlayerController : MoveCharacter
     }
 
     public bool isUltimate;     //英灵释放大招
+
+    void OnTransfigurate()      //变身
+    {
+        if (!isFloat && canMove)
+        {
+            if (!isTransfiguration)
+            {
+                Transfiguration((int)spirits.currentSpirit + 3);
+            }
+            else
+            {
+                isUltimate = true;
+            }
+        }
+    }
+
+    /*
     void OnSummonSpirit()   //法师
     {
         if (!isFloat && canMove)
@@ -543,6 +560,7 @@ public class PlayerController : MoveCharacter
             }
         }
     }
+    */
     public void Jump()
     {
         SetUpSpeed(jumpSpeed);

+ 4 - 2
ActionTowerDefense/Assets/Scripts/Spirits/BackDoor.cs

@@ -4,8 +4,10 @@ using UnityEngine;
 
 public class BackDoor : MonoBehaviour
 {
-    public GameObject door;
-    private Collider col;
+    public GameObject door1;
+    public GameObject door2;
+    private Collider col1;
+    private Collider col2;
 
     private int times = 2;
 

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

@@ -7,8 +7,8 @@ public class Spirits : MonoBehaviour
     public enum SpiritType          //Ó¢ÁéÖÖÀà
     {
         Float = 0,                  //Ư¸¡
-        Assassin = 1,               //³å´Ì
-        Cook = 2,                   //¿¾´®
+        Assassin = 1,               //´Ì¿Í
+        Cook = 2,                   //³øÊ¦
         Invisible = 3,              //ÒþÉí
     }
 

+ 3 - 152
ActionTowerDefense/Assets/Scripts/Spirits/Trans_Float.cs

@@ -34,161 +34,12 @@ public class Trans_Float : MonoBehaviour
         controller.uiMp.Show(controller.mp, controller.totalMp);
     }
 
-    /*
     private void Update()
     {
-        //硬直
-        if (!canAttack)
+        if (controller.isUltimate)
         {
-            pastAttackTime += Time.deltaTime;
-            if (pastAttackTime >= intervalTime)
-            {
-                canAttack = true;
-                pastAttackTime = 0;
-                controller.canMove = true;
-            }
-        }
-        if (isCDJ)
-        {
-            pastCDJ += Time.deltaTime;
-            if (pastCDJ >= CDJ)
-            {
-                isCDJ = false;
-                pastCDJ = 0;
-            }
-        }
-        if (isCDK)
-        {
-            pastCDK += Time.deltaTime;
-            if (pastCDK >= CDK)
-            {
-                isCDK = false;
-                pastCDK = 0;
-            }
-        }
-        if (isCDL)
-        {
-            pastCDL += Time.deltaTime;
-            if (pastCDL >= CDL)
-            {
-                isCDL = false;
-                pastCDL = 0;
-            }
-        }
-        //J
-        if (!isCDJ && controller.isinputJ && canAttack)
-        {
-            if (controller.mp >= mpJ)
-            {
-                isCDJ = true;
-                intervalTime = intervalTimeJ;
-                ToInterval(mpJ);
-                controller.isinputJ = false;
-                //首次攻击触发漂浮
-                if (isFirst)
-                {
-                    if (!dem.attackToFloat)
-                    {
-                        isFirst = false;
-                        dem.attackToFloat = true;
-                    }
-                }
-                //攻击保底min~max次触发漂浮
-                else
-                {
-                    if (!dem.attackToFloat)
-                    {
-                        times += 1;
-                        if (times >= minTime || times == maxTime)
-                        {
-                            times = 0;
-                            dem.attackToFloat = true;
-                        }
-                    }
-                }
-                dem.Attack2();
-            }
-            else
-            {
-                Debug.Log("mp不足");
-            }
-        }
-        //K
-        if (!isCDK && controller.isinputK)
-        {
-            if (controller.mp >= mpK)
-            {
-                if (!once)
-                {
-                    controller.canMove = false;
-                    controller.ChangeState(CharacterState.Idle);
-                    KContinueValue();
-                    once = true;
-                    isK = true;
-                    once = true;
-                    curlock.transform.position = transform.position;
-                    Vector3 orig = curlock.transform.localScale;
-                    curlock.transform.localScale = new Vector3(minRange, orig.y, orig.z);
-                    curlock.SetActive(true);
-                }
-                if (pastTime <= keepFloatTime)
-                {
-                    pastTime += Time.deltaTime;
-                    isLosingMp += continueMp * Time.deltaTime;
-                    if (isLosingMp >= mpK)
-                    {
-                        DeMp(mpK);
-                        isLosingMp -= mpK;
-                    }
-                    if (curlock.transform.localScale.x < maxRange)
-                    {
-                        curlock.transform.localScale += new Vector3(continueRange * Time.deltaTime, 0, 0);
-                    }
-                }
-            }
-            else
-            {
-                Debug.Log("mp不足");
-            }
-        }
-        if(isK && !controller.isinputK)
-        {
-            isCDK = true;
-            pastTime = 0;
-            isK = false;
-            intervalTime = intervalTimeK;
-            ToInterval(0);
-            once = false;
-            curFe.transform.position = curlock.transform.position;
-            Vector3 v = curFe.transform.localScale;
-            curFe.transform.localScale = new Vector3(curlock.transform.localScale.x, v.y, v.z);
-            curlock.SetActive(false);
-            curFe.SetActive(true);
-        }
-        //L
-        if (!isCDL && controller.isinputL)
-        {
-            if (controller.mp >= mpL)
-            {
-                isCDL = true;
-                intervalTime = intervalTimeL;
-                ToInterval(mpL);
-                controller.isinputL = false;
-                foreach (MoveCharacter f in FloatData.eneIsFloating)
-                {
-                    if (f.isFloat)
-                    {
-                        f.dropDamage = LAttackDamage;
-                        f.FloatDrop();
-                        FloatData.Clear(1);
-                    }
-                }
-            }
-            else
-            {
-                Debug.Log("mp不足");
-            }
+            controller.isUltimate = false;
+            controller.EndTransfiguration(controller.endChange);
         }
     }
-    */
 }