Ver código fonte

漂浮英灵的完美外貌

SZAND\msx_2 1 ano atrás
pai
commit
da9b9601d5

+ 2 - 2
ActionTowerDefense/Assets/Resources/Actions/Player.inputactions

@@ -69,7 +69,7 @@
                     "initialStateCheck": false
                 },
                 {
-                    "name": "SummonFloat",
+                    "name": "SummonSpirit",
                     "type": "Button",
                     "id": "227151c5-4c1f-41ed-acdc-7eee0733b71f",
                     "expectedControlType": "Button",
@@ -284,7 +284,7 @@
                     "interactions": "",
                     "processors": "",
                     "groups": "",
-                    "action": "SummonFloat",
+                    "action": "SummonSpirit",
                     "isComposite": false,
                     "isPartOfComposite": false
                 }

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

@@ -847,6 +847,7 @@ MonoBehaviour:
   - {x: -1, y: 0, z: 0}
   - {x: -1, y: 0, z: 0}
   - {x: -1, y: 0, z: 0}
+  - {x: -1, y: 0, z: 0}
   demonicId: 
   uiMp: {fileID: 8465211090008398057}
   playerRope: {fileID: 0}
@@ -890,6 +891,7 @@ MonoBehaviour:
   isClickBtnEast: 0
   isClickBtnWest: 0
   isClickBtnNorth: 0
+  isSpiritSummon: 0
   isKeepBtnNorth: 0
   leftDir: {x: 0, y: 0}
   playerId: 0
@@ -1201,7 +1203,7 @@ BoxCollider:
   m_IsTrigger: 1
   m_Enabled: 1
   serializedVersion: 2
-  m_Size: {x: 19.2, y: 10.8, z: 0.2}
+  m_Size: {x: 33.7294, y: 59.344574, z: 0.2}
   m_Center: {x: 0, y: 0, z: 0}
 --- !u!1 &5553794633741559699
 GameObject:

+ 3 - 2
ActionTowerDefense/Assets/Resources/Prefab/Spirits_Float.prefab

@@ -292,7 +292,7 @@ Animator:
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 2234394376273647362}
-  m_Enabled: 0
+  m_Enabled: 1
   m_Avatar: {fileID: 0}
   m_Controller: {fileID: 9100000, guid: 2951b5820f17f3f4fb10e136bb42a4c6, type: 2}
   m_CullingMode: 0
@@ -1033,7 +1033,8 @@ MonoBehaviour:
   hurtChangeVelocity: 1
   maxSpeed: 10
   minSpeed: 2
-  height: 8
+  maxHeight: 12
+  minHeight: 7
   maxRotateSpeed: 10
   minRotateSpeed: 4
   floatTime: 5

+ 2 - 5
ActionTowerDefense/Assets/Scripts/MoveCharacter.cs

@@ -51,9 +51,9 @@ public class MoveCharacter : Character
     public void FloatStateOn()
     {
         maxSpeed = 15; 
-        minSpeed = 6;
+        minSpeed = 2;
         maxHeight = 9;
-        minHeight = 6;
+        minHeight = 4;
 
         floatTime = 20;     
         ChangeState(CharacterState.Rise);
@@ -65,9 +65,6 @@ public class MoveCharacter : Character
         rotateSpeed = Random.Range(minRotateSpeed, maxRotateSpeed);
         rotateDir = (1.5f - Random.Range(1, 3)) * 2;
         height = Random.Range(minHeight, maxHeight);
-        print(minHeight);
-        print(maxHeight);
-        print(height);
     }
 
     private void RotateSelf()

+ 29 - 3
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -90,6 +90,10 @@ public class PlayerController : MoveCharacter
     public float attackMoveSpeed = 5f;
     public Vector3 rushDir;
 
+    private int currentSpirit;  //当前将要召唤的英灵种类
+    private Spirits spirits;
+    
+
     public bool btnJumpPress
     {
         get
@@ -160,6 +164,16 @@ public class PlayerController : MoveCharacter
     }
     [HideInInspector]
     public bool isClickBtnNorth;
+    public bool btnSpiritSummon
+    {
+        get
+        {
+            //return Input.GetKeyDown(KeyCode.I) || isClickBtnNorth;
+            return isSpiritSummon;
+        }
+    }
+    [HideInInspector]
+    public bool isSpiritSummon;
     public bool btnNorthKeep
     {
         get
@@ -211,6 +225,7 @@ public class PlayerController : MoveCharacter
     private void Awake()
     {
         PlayerInput playerInput = transform.GetComponent<PlayerInput>();
+        spirits = GetComponent<Spirits>();
         playerId = playerInput.playerIndex;
         if (playerId == 0)
         {
@@ -311,9 +326,9 @@ public class PlayerController : MoveCharacter
     {
         isClickBtnEast = true;
     }
-    void OnSummonFloat()
-    { 
-
+    void OnSummonSpirit()
+    {
+        isSpiritSummon = true;
     }
     public void Jump()
     {
@@ -359,6 +374,11 @@ public class PlayerController : MoveCharacter
             Summon(2);
             return true;
         }
+        if (isSpiritSummon)
+        {
+            Summon((int)spirits.currentSpirit + 3);
+            return true;
+        }
         return false;
     }
 
@@ -489,6 +509,11 @@ public class PlayerController : MoveCharacter
             cacheSummonTime = totalCacheSummonTime;
             cacheSummonId = 2;
         }
+        if (btnSpiritSummon)
+        {
+            cacheSummonTime = totalCacheSummonTime;
+            cacheSummonId = (int)spirits.currentSpirit + 3;
+        }
     }
 
     public override void OnState()
@@ -906,6 +931,7 @@ public class PlayerController : MoveCharacter
         isClickBtnEast = false;
         isClickBtnNorth = false;
         isClickBtnWest = false;
+        isSpiritSummon = false;
 
         if (foot.TrigGround)
         {

+ 5 - 4
ActionTowerDefense/Assets/Scripts/Spirits/Spirits.cs

@@ -6,13 +6,14 @@ public class Spirits : MonoBehaviour
 {
     public enum SpiritType  //Ó¢ÁéÖÖÀà
     {
-        Dash = 0,       //³å´Ì
-        Float = 1,      //Ư¸¡
+        Float = 0,       //Ư¸¡
+        Dash = 1,      //³å´Ì
         Kebab = 2,      //¿¾´®
         Invisible = 3,  //ÒþÉí
     }
-
+    
     private GameObject floatSpirit;
+
     public SpiritType currentSpirit;
 
     private void disappear()
@@ -29,7 +30,6 @@ public class Spirits : MonoBehaviour
                 {
                     floatSpirit = GameObject.Find("Capsule").gameObject;
                 }
-                
                 if (floatSpirit.activeSelf)
                 {
                     floatSpirit.SetActive(false);
@@ -52,6 +52,7 @@ public class Spirits : MonoBehaviour
 
     }
 
+    
     private void Update()
     {
         if (Input.GetKeyDown(KeyCode.P))