Ver Fonte

泰山压顶修复

SZAND\msx_2 há 10 meses atrás
pai
commit
38eb1739eb

+ 84 - 3
ActionTowerDefense/Assets/Resources/Prefab/Conduct/Mountain.prefab

@@ -1,5 +1,69 @@
 %YAML 1.1
 %TAG !u! tag:unity3d.com,2011:
+--- !u!1 &4531567214190808138
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 8563578230082023832}
+  - component: {fileID: 7956485234543872177}
+  - component: {fileID: 2933622689745331380}
+  m_Layer: 0
+  m_Name: Foot
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &8563578230082023832
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4531567214190808138}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: -0.5, z: 0}
+  m_LocalScale: {x: 1, y: 0.4, z: 2}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 7312977071883604062}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!65 &7956485234543872177
+BoxCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4531567214190808138}
+  m_Material: {fileID: 0}
+  m_IsTrigger: 1
+  m_Enabled: 1
+  serializedVersion: 2
+  m_Size: {x: 1, y: 0.003, z: 20}
+  m_Center: {x: 0, y: 0, z: 0}
+--- !u!114 &2933622689745331380
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4531567214190808138}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: c42213c575288a148b692aad7ab56bab, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  rb: {fileID: 0}
+  haveGravity: 1
+  trigGroundList: []
+  myBaGuaTrigger: {fileID: 0}
+  baGuaTrigger: []
+  notOnGiant: 1
 --- !u!1 &8587706472837483213
 GameObject:
   m_ObjectHideFlags: 0
@@ -12,6 +76,7 @@ GameObject:
   - component: {fileID: 6584883322373862942}
   - component: {fileID: 2415009481297058421}
   - component: {fileID: 9182506666843595699}
+  - component: {fileID: 2978647577318575682}
   m_Layer: 0
   m_Name: Mountain
   m_TagString: Untagged
@@ -30,7 +95,8 @@ Transform:
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 15, y: 5, z: 1}
   m_ConstrainProportionsScale: 0
-  m_Children: []
+  m_Children:
+  - {fileID: 8563578230082023832}
   m_Father: {fileID: 0}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -112,7 +178,22 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   comaTime: 3
-  comaDamage: 0
-  continueTime: 0
   pc: {fileID: 0}
   id: 0
+  foot: {fileID: 2933622689745331380}
+--- !u!54 &2978647577318575682
+Rigidbody:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8587706472837483213}
+  serializedVersion: 2
+  m_Mass: 1
+  m_Drag: 0
+  m_AngularDrag: 0.05
+  m_UseGravity: 1
+  m_IsKinematic: 0
+  m_Interpolate: 0
+  m_Constraints: 122
+  m_CollisionDetection: 0

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

@@ -1003,7 +1003,7 @@ MonoBehaviour:
   - 0
   - 0
   - 0
-  conductSkills: 060000000000000004000000
+  conductSkills: 060000000300000004000000
   conductCanRelease: 010101
   conductReadyTip: {fileID: 946637326309089849}
   bigGiant: {fileID: 5440846222648032759, guid: d64528a2dcc945b4a9ea5d5a859679f3, type: 3}
@@ -1018,7 +1018,6 @@ MonoBehaviour:
   attackEffect: {fileID: 417478504669294145, guid: 3b9e1b8087a2c2441a51fff8fec35d4f, type: 3}
   mountain: {fileID: 8587706472837483213, guid: d966b0d5004eaad49b37c963f1aaa584, type: 3}
   offset: {x: 0, y: 7, z: 0}
-  mountainTime: 5
   wavePowerObj: {fileID: 8625694250200680089, guid: 2ee85ceccd170b94b8ba929f3b58af5f, type: 3}
   flyingSwordsObj: {fileID: 256012001268456902, guid: 28fffa39583087344b7b2620e7284dd5, type: 3}
   angryBulletObj: {fileID: 8625694250200680089, guid: 4a30da3dcf83256468df404f06d44533, type: 3}

+ 4 - 5
ActionTowerDefense/Assets/Scripts/Conduct/Mountain.cs

@@ -5,15 +5,13 @@ using UnityEngine;
 public class Mountain : MonoBehaviour
 {
     public float comaTime;
-    public int comaDamage;
-    public float continueTime;
     public PlayerController pc;
     public int id;
+    public Foot foot;
 
     private void Update()
     {
-        continueTime -= Time.deltaTime;
-        if (continueTime <= 0)
+        if (foot.TrigGround)
         {
             gameObject.SetActive(false);
             pc.conductCanRelease[id] = true;
@@ -30,9 +28,10 @@ public class Mountain : MonoBehaviour
                 en.willBeFly = true;
                 //en.canFly = false;
             }
-            en.ChangeState(CharacterState.Weak);
+            en.willComaTime = comaTime;
             en.willBeComa = true;
             en.comaDamage = pc.swordNum * 100;
+            en.ChangeState(CharacterState.Fall);
         }
     }
 }

+ 15 - 3
ActionTowerDefense/Assets/Scripts/Enemy.cs

@@ -749,6 +749,13 @@ public class Enemy : MoveCharacter
                 canMove = true;
                 break;
             case CharacterState.Coma:
+                ani.Play("idle", 0, 0);
+                aniCollider.Play("Idle", 0, 0);
+                if (canFly)
+                {
+                    rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezePositionY;
+                    rb.useGravity = false;
+                }
                 canMove = true;
                 break;
             case CharacterState.FindPlayer:
@@ -835,13 +842,18 @@ public class Enemy : MoveCharacter
                 if (willBeComa)
                 {
                     BeHit(comaDamage, Vector3.zero, false, 0);
-                    canFly = true;
                 }
                 //ani.Play("Coma", 0, 0);
-                ani.Play("idle", 0, 0);
-                aniCollider.Play("Idle", 0, 0);
+                ani.Play("weak", 0, 0);
+                aniCollider.Play("Weak", 0, 0);
                 rb.velocity = Vector3.zero;
                 pastComaTime = 0;
+                if (canFly)
+                {
+                    rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
+                    rb.useGravity = true;
+                    flyHeight = Random.Range(minHeight, maxHeight);
+                }
                 break;
             case CharacterState.Attack:
                 break;

+ 9 - 0
ActionTowerDefense/Assets/Scripts/Foot.cs

@@ -17,6 +17,7 @@ public class Foot : MonoBehaviour
     public List<GameObject> trigGroundList;
     public BaGuaTrigger myBaGuaTrigger;                                      //×Ô¼º
     public List<BaGuaTrigger> baGuaTrigger = new List<BaGuaTrigger>();       //½ÅÏÂµÄ°ËØÔÅÖ×Ó
+    public bool notOnGiant;
 
     private void Update()
     {
@@ -81,6 +82,14 @@ public class Foot : MonoBehaviour
     {
         if (other.CompareTag("Plane"))
         {
+            if (notOnGiant)
+            {
+                Platform platform = other.gameObject.GetComponent<Platform>();
+                if (platform)
+                {
+                    return;
+                }
+            }
             trigGroundList.Add(other.gameObject);
         }
     }

+ 4 - 11
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -181,8 +181,6 @@ public class PlayerController : MoveCharacter
     //̩ɽѹ¶¥
     public GameObject mountain;
     public Vector3 offset;
-    private GameObject curMountain;
-    public float mountainTime;
     //Æø¹¦²¨
     public GameObject wavePowerObj;
     //Óù½£Êõ
@@ -826,15 +824,10 @@ public class PlayerController : MoveCharacter
                     if (demonicDic[2].Count > 0)
                     {
                         conductCanRelease[cacheConductId] = false;
-                        if (curMountain == null)
-                        {
-                            curMountain = GameObject.Instantiate(mountain, transform);
-                            curMountain.transform.position = transform.position + offset;
-                            curMountain.GetComponent<Mountain>().pc = this;
-                            curMountain.GetComponent<Mountain>().id = cacheConductId;
-                        }
-                        curMountain.SetActive(true);
-                        curMountain.GetComponent<Mountain>().continueTime = mountainTime;
+                        GameObject curMountain = Instantiate(mountain, null);
+                        curMountain.transform.position = transform.position + offset;
+                        curMountain.GetComponent<Mountain>().pc = this;
+                        curMountain.GetComponent<Mountain>().id = cacheConductId;
                     }
                     else
                     {