Sfoglia il codice sorgente

最后5秒加特效

LAPTOP-OM1V99U2\永远de小亡灵 1 anno fa
parent
commit
0c9b2681a7

+ 8 - 1
ActionTowerDefense/Assets/Resources/Prefab/Spirits_Invisible.prefab

@@ -168,7 +168,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 0a404b1e6e4d077448ed17eaef088ae7, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  duration: 30
+  duration: 10
+  lastDuration: 5
+  lastEffect: {fileID: 7389322373366771577}
   time: 0
   demonic: {fileID: 2437299196472462353}
   player: {fileID: 0}
@@ -1110,3 +1112,8 @@ Transform:
   m_CorrespondingSourceObject: {fileID: 7473170563405908937, guid: 7a1ed32670b9b2e4e9b10e0632c36180, type: 3}
   m_PrefabInstance: {fileID: 7464584808883890403}
   m_PrefabAsset: {fileID: 0}
+--- !u!1 &7389322373366771577 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 79848569989908378, guid: 7a1ed32670b9b2e4e9b10e0632c36180, type: 3}
+  m_PrefabInstance: {fileID: 7464584808883890403}
+  m_PrefabAsset: {fileID: 0}

+ 7 - 1
ActionTowerDefense/Assets/Scripts/Spirits/Spirits_Invisible.cs

@@ -6,6 +6,8 @@ using Spine.Unity;
 public class Spirits_Invisible : MonoBehaviour
 {
     public float duration;
+    public float lastDuration;
+    public GameObject lastEffect;
     [HideInInspector]
     public float time;
     public Demonic demonic;
@@ -72,6 +74,7 @@ public class Spirits_Invisible : MonoBehaviour
         }
         time += Time.deltaTime;
         
+
         if (time >= duration)
         {
             playerController.rb.useGravity = true;
@@ -84,6 +87,9 @@ public class Spirits_Invisible : MonoBehaviour
             demonic.ChangeState(CharacterState.Die);
             gameObject.SetActive(false);
         }
-        
+        else if (time >= duration - lastDuration)
+        {
+            lastEffect.SetActive(true);
+        }
     }
 }