Explorar o código

新增敌方隐身英灵

LAPTOP-OM1V99U2\永远de小亡灵 hai 1 ano
pai
achega
0d99257fc5

+ 13 - 13
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Invisible.prefab

@@ -17,7 +17,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!4 &5061628209490452354
 Transform:
   m_ObjectHideFlags: 0
@@ -169,7 +169,7 @@ MonoBehaviour:
   state: 0
   rb: {fileID: 2437299196472462355}
   moveSpeed: 5
-  upMoveSpeed: 15
+  upMoveSpeed: 10
   altitude: 7
   randomRageY: 5
   randomRageX: 5
@@ -215,6 +215,8 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 7475a7d33f657b146a4994b1e02710ad, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  cookNum: 0
+  cooks: []
   mecanim: {fileID: 4509017029252731830}
   meshRenderer: {fileID: 5962745018198423514}
   ani: {fileID: 2559904981682034569}
@@ -233,16 +235,11 @@ MonoBehaviour:
   totalHp: 5000
   hp: 0
   attack1Infos:
-  - damage: 10
+  - damage: 400
     attackDir: {x: 2, y: 1, z: 0}
     force: 1000
-    changeHurt: 0
-    repelValue: 0
-  - damage: 10
-    attackDir: {x: -2, y: 1, z: 0}
-    force: 1000
-    changeHurt: 0
-    repelValue: 0
+    changeHurt: 1
+    repelValue: 10
   attack2Infos:
   - damage: 10
     attackDir: {x: 2, y: 1, z: 0}
@@ -308,7 +305,7 @@ MonoBehaviour:
   noOnSearchState: 1
   isFindingPlayer: 0
   isFindPlayer: 0
-  hateDistance: 0
+  hateDistance: 1
   distance: 0
   rushEndPos: {x: 0, y: 0, z: 0}
   aimEffect: {fileID: 0}
@@ -322,6 +319,7 @@ MonoBehaviour:
   haveDownRush: 0
   downRushTime: 0
   finishRushTime: 0
+  isBack: 0
 --- !u!1 &2437299196663985757
 GameObject:
   m_ObjectHideFlags: 0
@@ -699,6 +697,8 @@ MonoBehaviour:
   eSpirits: {fileID: 3269304469610989911}
   soulsList: []
   distance: 1.5
+  boomTime: 3
+  destroyTime: 3
 --- !u!1 &8203964573996106666
 GameObject:
   m_ObjectHideFlags: 0
@@ -1008,7 +1008,7 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 8814998367958131660}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 8.01, y: 0, z: 0}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 0.35999998, y: 0.35999998, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
@@ -1179,7 +1179,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 7473170563405908938, guid: 7a1ed32670b9b2e4e9b10e0632c36180, type: 3}
       propertyPath: m_Name
-      value: Invisible_effc
+      value: InvisibleEffect
       objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_SourcePrefab: {fileID: 100100000, guid: 7a1ed32670b9b2e4e9b10e0632c36180, type: 3}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 190 - 222
ActionTowerDefense/Assets/Resources/Prefab/FX/FollowSoulEffect.prefab


+ 1 - 1
ActionTowerDefense/Assets/Resources/Prefab/FX/Invisible_effc.prefab → ActionTowerDefense/Assets/Resources/Prefab/FX/InvisibleEffect.prefab

@@ -19513,7 +19513,7 @@ GameObject:
   m_Component:
   - component: {fileID: 7473170563405908937}
   m_Layer: 0
-  m_Name: Invisible_effc
+  m_Name: InvisibleEffect
   m_TagString: Untagged
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0

+ 0 - 0
ActionTowerDefense/Assets/Resources/Prefab/FX/Invisible_effc.prefab.meta → ActionTowerDefense/Assets/Resources/Prefab/FX/InvisibleEffect.prefab.meta


+ 28 - 1
ActionTowerDefense/Assets/Scripts/Spirits/ESpirits_Invisible.cs

@@ -7,6 +7,8 @@ public enum InvisibleState
     Normal = 0, //攣끽榴檄
     Hurt = 1,   //굳댔榴檄
     FindSoul = 2,   //冷산榴檄
+    FindPlayer = 3, //冷鯤소
+    Boom = 4,   //괵珞
 }
 public class ESpirits_Invisible : MonoBehaviour
 {
@@ -104,7 +106,7 @@ public class ESpirits_Invisible : MonoBehaviour
                         followEffect.ShowSouls(haveSoulNumber);
                         if(haveSoulNumber == followNumber)
                         {
-                            ChangeState(InvisibleState.Normal);
+                            ChangeState(InvisibleState.FindPlayer);
                             break;
                         }
                         FindSoul();
@@ -122,6 +124,18 @@ public class ESpirits_Invisible : MonoBehaviour
                 targetPos = targetSoul.transform.position;
                 Goto(targetPos, upMoveSpeed);
                 
+                break;
+            case InvisibleState.FindPlayer:
+                if (Vector3.Distance(transform.position, 
+                    enemy.targetCharacter.transform.position + Vector3.up * 0.5f)<= enemy.hateDistance)
+                {
+                    ChangeState(InvisibleState.Boom);
+                    break;
+                }
+                Goto(enemy.targetCharacter.transform.position + Vector3.up*0.5f, upMoveSpeed);
+                break;
+            case InvisibleState.Boom:
+                ChangeState(InvisibleState.Normal);
                 break;
             default:
                 break;
@@ -138,6 +152,10 @@ public class ESpirits_Invisible : MonoBehaviour
                 break;
             case InvisibleState.FindSoul:
                 break;
+            case InvisibleState.FindPlayer:
+                break;
+            case InvisibleState.Boom:
+                break;
             default:
                 break;
         }
@@ -155,6 +173,15 @@ public class ESpirits_Invisible : MonoBehaviour
             case InvisibleState.FindSoul:
                 FindSoul();
                 break;
+            case InvisibleState.FindPlayer:
+                enemy.ChosePlayer();
+                break;
+            case InvisibleState.Boom:
+                rb.velocity = Vector3.zero;
+                followEffect.ShowSouls(0);
+                followEffect.Boom();
+                haveSoulNumber = 0;
+                break;
             default:
                 break;
         }

+ 68 - 0
ActionTowerDefense/Assets/Scripts/Spirits/SoulBoom.cs

@@ -0,0 +1,68 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class SoulBoom : MonoBehaviour
+{
+    [HideInInspector]
+    public float time;
+    [HideInInspector]
+    public float boomTime;
+    [HideInInspector]
+    public bool isBoom;
+    [HideInInspector]
+    public AttackInfo attackInfo;
+    [HideInInspector]
+    public float destroyTime;
+    public List<Character> characters = new List<Character>();
+    private void Update()
+    {
+        time += Time.deltaTime;
+        if (time >= boomTime)
+        {
+            if (!isBoom)
+            {
+                for(int i = 0; i < characters.Count; i++)
+                {
+                    if (characters[i].state == CharacterState.Die)
+                    {
+                        continue;
+                    }
+                    characters[i].BeHit
+                        (attackInfo.damage, Vector3.zero, attackInfo.changeHurt, attackInfo.repelValue);
+                    isBoom = true;
+                }
+
+            }
+            
+        }
+        if (time >= destroyTime)
+        {
+            gameObject.SetActive(false);
+        }
+    }
+    private void OnTriggerEnter(Collider other)
+    {
+        if ((other.gameObject.layer == 6 || other.gameObject.layer == 7)
+            && other.name == "BodyCollider")
+        {
+            Character character = other.GetComponentInParent<Character>();
+            if (!characters.Exists(t => t == character))
+            {
+                characters.Add(character);
+            }
+        }
+    }
+    private void OnTriggerExit(Collider other)
+    {
+        if ((other.gameObject.layer == 6 || other.gameObject.layer == 7)
+            && other.name == "BodyCollider")
+        {
+            Character character = other.GetComponentInParent<Character>();
+            if (characters.Exists(t => t == character))
+            {
+                characters.Remove(character);
+            }
+        }
+    }
+}

+ 11 - 0
ActionTowerDefense/Assets/Scripts/Spirits/SoulBoom.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a7ca44b9cabcdeb4bb198cc532b04e86
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 20 - 1
ActionTowerDefense/Assets/Scripts/Spirits/SoulFollowEffect.cs

@@ -13,11 +13,13 @@ public class SoulFollowEffect : MonoBehaviour
     [HideInInspector]
     public List<GameObject> soulsList = new List<GameObject>();
     public float distance;
+    public float boomTime;
+    public float destroyTime;
     private void Awake()
     {
         for(int i = 0; i < eSpirits.followNumber; i++)
         {
-            GameObject newSoul = Instantiate(soul);
+            GameObject newSoul = Instantiate(soul.transform.GetChild(0).gameObject);
             newSoul.transform.parent = transform;
             newSoul.SetActive(false);
             soulsList.Add(newSoul);
@@ -32,6 +34,16 @@ public class SoulFollowEffect : MonoBehaviour
         }
         transform.rotation = Quaternion.Euler(new Vector3(0, 0, angle));
     }
+    public void Boom()
+    {
+        GameObject boomSoul = Instantiate(soul.transform.GetChild(1).gameObject);
+        boomSoul.transform.position = transform.position;
+        SoulBoom soulBoom = boomSoul.GetComponent<SoulBoom>();
+        soulBoom.boomTime = boomTime;
+        soulBoom.attackInfo = GetComponentInParent<Enemy>().attack1Infos[0];
+        soulBoom.destroyTime = destroyTime;
+        boomSoul.SetActive(true);
+    }
     public void ShowSouls(int newNumber)
     {
 
@@ -47,6 +59,13 @@ public class SoulFollowEffect : MonoBehaviour
             }
 
         }
+        else
+        {
+            for(int i = 0;i< eSpirits.followNumber; i++)
+            {
+                soulsList[i].gameObject.SetActive(false);
+            }
+        }
         
         soulsNumber = newNumber;
     }

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio