Ver código fonte

修复传送门核心不会爆炸bug

LAPTOP-OM1V99U2\永远de小亡灵 1 ano atrás
pai
commit
218cdbdfbe

+ 25 - 2
ActionTowerDefense/Assets/Animations/Portals/Portals.controller

@@ -32,7 +32,8 @@ AnimatorState:
   m_Name: Create
   m_Speed: 1
   m_CycleOffset: 0
-  m_Transitions: []
+  m_Transitions:
+  - {fileID: 7584057565110712974}
   m_StateMachineBehaviours: []
   m_Position: {x: 50, y: 50, z: 0}
   m_IKOnFeet: 0
@@ -68,7 +69,7 @@ AnimatorState:
   m_MirrorParameterActive: 0
   m_CycleOffsetParameterActive: 0
   m_TimeParameterActive: 0
-  m_Motion: {fileID: 0}
+  m_Motion: {fileID: 7400000, guid: 2ad4e5d369b7dd74d969ee81f3c23894, type: 2}
   m_Tag: 
   m_SpeedParameter: 
   m_MirrorParameter: 
@@ -99,3 +100,25 @@ AnimatorStateMachine:
   m_ExitPosition: {x: 800, y: 120, z: 0}
   m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
   m_DefaultState: {fileID: 1273680995483375833}
+--- !u!1101 &7584057565110712974
+AnimatorStateTransition:
+  m_ObjectHideFlags: 1
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: 
+  m_Conditions: []
+  m_DstStateMachine: {fileID: 0}
+  m_DstState: {fileID: 1273680995483375833}
+  m_Solo: 0
+  m_Mute: 0
+  m_IsExit: 0
+  serializedVersion: 3
+  m_TransitionDuration: 0.25
+  m_TransitionOffset: 0
+  m_ExitTime: 0.975
+  m_HasExitTime: 1
+  m_HasFixedDuration: 1
+  m_InterruptionSource: 0
+  m_OrderedInterruption: 1
+  m_CanTransitionToSelf: 1

+ 16 - 16
ActionTowerDefense/Assets/Animations/Portals/Portals_Create.anim

@@ -122,7 +122,7 @@ AnimationClip:
       m_Curve:
       - serializedVersion: 3
         time: 0
-        value: 0
+        value: 1
         inSlope: Infinity
         outSlope: Infinity
         tangentMode: 103
@@ -130,7 +130,7 @@ AnimationClip:
         inWeight: 0
         outWeight: 0
       - serializedVersion: 3
-        time: 10
+        time: 9.983334
         value: 1
         inSlope: Infinity
         outSlope: Infinity
@@ -158,7 +158,7 @@ AnimationClip:
         inWeight: 0
         outWeight: 0
       - serializedVersion: 3
-        time: 10
+        time: 9.983334
         value: 1
         inSlope: Infinity
         outSlope: Infinity
@@ -186,7 +186,7 @@ AnimationClip:
         inWeight: 0
         outWeight: 0
       - serializedVersion: 3
-        time: 10
+        time: 9.983334
         value: 1
         inSlope: Infinity
         outSlope: Infinity
@@ -214,7 +214,7 @@ AnimationClip:
         inWeight: 0
         outWeight: 0
       - serializedVersion: 3
-        time: 10
+        time: 9.983334
         value: 0
         inSlope: Infinity
         outSlope: Infinity
@@ -242,7 +242,7 @@ AnimationClip:
         inWeight: 0
         outWeight: 0
       - serializedVersion: 3
-        time: 10
+        time: 9.983334
         value: 0
         inSlope: Infinity
         outSlope: Infinity
@@ -270,7 +270,7 @@ AnimationClip:
         inWeight: 0
         outWeight: 0
       - serializedVersion: 3
-        time: 10
+        time: 9.983334
         value: 1
         inSlope: Infinity
         outSlope: Infinity
@@ -298,7 +298,7 @@ AnimationClip:
         inWeight: 0
         outWeight: 0
       - serializedVersion: 3
-        time: 10
+        time: 9.983334
         value: 1
         inSlope: Infinity
         outSlope: Infinity
@@ -761,7 +761,7 @@ AnimationClip:
       m_Curve:
       - serializedVersion: 3
         time: 0
-        value: 0
+        value: 1
         inSlope: Infinity
         outSlope: Infinity
         tangentMode: 103
@@ -769,7 +769,7 @@ AnimationClip:
         inWeight: 0
         outWeight: 0
       - serializedVersion: 3
-        time: 10
+        time: 9.983334
         value: 1
         inSlope: Infinity
         outSlope: Infinity
@@ -797,7 +797,7 @@ AnimationClip:
         inWeight: 0
         outWeight: 0
       - serializedVersion: 3
-        time: 10
+        time: 9.983334
         value: 1
         inSlope: Infinity
         outSlope: Infinity
@@ -825,7 +825,7 @@ AnimationClip:
         inWeight: 0
         outWeight: 0
       - serializedVersion: 3
-        time: 10
+        time: 9.983334
         value: 1
         inSlope: Infinity
         outSlope: Infinity
@@ -853,7 +853,7 @@ AnimationClip:
         inWeight: 0
         outWeight: 0
       - serializedVersion: 3
-        time: 10
+        time: 9.983334
         value: 0
         inSlope: Infinity
         outSlope: Infinity
@@ -881,7 +881,7 @@ AnimationClip:
         inWeight: 0
         outWeight: 0
       - serializedVersion: 3
-        time: 10
+        time: 9.983334
         value: 0
         inSlope: Infinity
         outSlope: Infinity
@@ -909,7 +909,7 @@ AnimationClip:
         inWeight: 0
         outWeight: 0
       - serializedVersion: 3
-        time: 10
+        time: 9.983334
         value: 1
         inSlope: Infinity
         outSlope: Infinity
@@ -937,7 +937,7 @@ AnimationClip:
         inWeight: 0
         outWeight: 0
       - serializedVersion: 3
-        time: 10
+        time: 9.983334
         value: 1
         inSlope: Infinity
         outSlope: Infinity

+ 3 - 2
ActionTowerDefense/Assets/Resources/Prefab/Portal/Portals.prefab

@@ -260,7 +260,7 @@ MonoBehaviour:
   createTimeCountDown: 0
   totalCreateTimeCountDown: 10
   ani: {fileID: 4157785550026956461}
-  UI: {fileID: 0}
+  portalUIParent: {fileID: 0}
 --- !u!95 &4157785550026956461
 Animator:
   serializedVersion: 4
@@ -1269,7 +1269,7 @@ MonoBehaviour:
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 4114050233808610390}
-  m_Enabled: 0
+  m_Enabled: 1
   m_EditorHideFlags: 0
   m_Script: {fileID: 11500000, guid: 2f4d4e139a563424a9ff72572136a6ea, type: 3}
   m_Name: 
@@ -1331,6 +1331,7 @@ MonoBehaviour:
   portals:
   - {fileID: 6204547102456506843}
   - {fileID: 2840691249036693841}
+  enemyUI: {fileID: 4382259613569250176}
 --- !u!1 &4382259613569250176
 GameObject:
   m_ObjectHideFlags: 0

+ 3 - 1
ActionTowerDefense/Assets/Scripts/Portal/CoreCharacter.cs

@@ -15,6 +15,7 @@ public class CoreCharacter : Character
     public TextMeshProUGUI[] countDown = new TextMeshProUGUI[2];
     public bool isCoutDown; //ÊÇ·ñ¿ªÊ¼µ¹¼ÆÊ±
     public GameObject[] portals = new GameObject[2];
+    public GameObject enemyUI;
 
     private void Update()
     {
@@ -50,7 +51,8 @@ public class CoreCharacter : Character
     {
         bodyTrans.gameObject.SetActive(false);
         uiHp.gameObject.SetActive(false);
-        for(int i = 0; i < countDown.Length; i++)
+        enemyUI.SetActive(false);
+        for (int i = 0; i < countDown.Length; i++)
         {
             if (portals[i].transform.localScale.x < 0)
             {

+ 14 - 0
ActionTowerDefense/Assets/Scripts/Portal/PortalsCreater.cs

@@ -25,6 +25,14 @@ public class PortalsCreater : MonoBehaviour
     public Animator ani;                        //传送门动画
     public Transform portalUIParent;               //传送门出现提示UI的父物体
 
+    private void Start()
+    {
+        for (int i = 0; i < show.Length; i++)
+        {
+            show[i].SetActive(false);
+        }
+    }
+
     private void Update()
     {
         if (createTimeCountDown > 0)
@@ -42,6 +50,12 @@ public class PortalsCreater : MonoBehaviour
             if (portalsDownUI.gameObject.activeSelf)
             {
                 portalsDownUI.gameObject.SetActive(false);
+                countDowns[0].gameObject.SetActive(false);
+                countDowns[1].gameObject.SetActive(false);
+                for (int i = 0; i < show.Length; i++)
+                {
+                    show[i].SetActive(true);
+                }
             }
         }
     }

+ 1 - 2
ActionTowerDefense/Assets/Scripts/SearchTrigger.cs

@@ -91,8 +91,7 @@ public class SearchTrigger : MonoBehaviour
                 || trigObjList[i].owner.tag == "Player" && HasTargetType(targetTypes, TargetType.Player)
                 || trigObjList[i].owner.tag == "Enemy" && HasTargetType(targetTypes, TargetType.Enemy)
                 || trigObjList[i].owner.tag == "EnemyTower" && HasTargetType(targetTypes, TargetType.EnemyTower)
-                || trigObjList[i].owner.tag == "Boss" && HasTargetType(targetTypes, TargetType.Boss)
-                || trigObjList[i].owner.tag == "Portal" && HasTargetType(targetTypes, TargetType.Portal))
+                || trigObjList[i].owner.tag == "Boss" && HasTargetType(targetTypes, TargetType.Boss))
             {
                 Character character = trigObjList[i].owner;
                 if (!character.gameObject.activeInHierarchy || character.isDie)