LAPTOP-OM1V99U2\永远de小亡灵 1 год назад
Родитель
Сommit
dbdcc0af5b

+ 100 - 4
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Invisible.prefab

@@ -100,7 +100,7 @@ Transform:
   - {fileID: 3277761006413294872}
   - {fileID: 2288379621507428556}
   m_Father: {fileID: 2730232521377132808}
-  m_RootOrder: 3
+  m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!95 &7460010523729932468
 Animator:
@@ -223,6 +223,8 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 7475a7d33f657b146a4994b1e02710ad, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  isTran: 0
+  pc: {fileID: 0}
   HitCols:
   - {fileID: 6526817785665782971}
   - {fileID: 8769150919382874379}
@@ -291,6 +293,10 @@ MonoBehaviour:
   minHurtKeepTime: 0.2
   hurtKeepTime: 0
   hurtChangeVelocity: 1
+  comaTime: 5
+  pastComaTime: 0
+  isCaughtByCook: 0
+  isBeDropped: 0
   maxTime: 1.5
   minTime: 0.1
   maxHeight: 9
@@ -301,6 +307,7 @@ MonoBehaviour:
   isFloat: 0
   normalFallSpeed: 10
   rapidFallSpeed: 30
+  curFallSpeed: 0
   floatState: 0
   spinee: {fileID: 0}
   mesh: {fileID: 0}
@@ -447,8 +454,9 @@ Transform:
   m_Children:
   - {fileID: 8189874817510154373}
   - {fileID: 9430913901011754}
-  - {fileID: 421881387528726774}
   - {fileID: 7794457276998281569}
+  - {fileID: 421881387528726774}
+  - {fileID: 2790126112879694142}
   m_Father: {fileID: 2437299196472462364}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -716,7 +724,7 @@ Transform:
   m_ConstrainProportionsScale: 0
   m_Children: []
   m_Father: {fileID: 2730232521377132808}
-  m_RootOrder: 2
+  m_RootOrder: 3
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!114 &4700054336262876788
 MonoBehaviour:
@@ -733,13 +741,19 @@ MonoBehaviour:
   angle: 0
   soulsNumber: 0
   rotateSpeed: 90
-  soul: {fileID: 1723151111827507807, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+  soul: {fileID: 2790126111997635467}
   eSpirits: {fileID: 3269304469610989911}
   soulsList: []
   distance: 1.5
   boomTime: 3
   destroyTime: 3
   isTransfiguration: 0
+  KBoomSoulTime: 0
+  soulBoom: {fileID: 2061548984477852820}
+  isBooming: 0
+  isBoom: 0
+  boomSoulNumber: 0
+  soulCollector: {fileID: 0}
 --- !u!1 &8203964573996106666
 GameObject:
   m_ObjectHideFlags: 0
@@ -1167,6 +1181,88 @@ MonoBehaviour:
     layerMixModes: 01000000
     layerBlendModes: 01000000
   updateTiming: 1
+--- !u!1001 &3553718495943334757
+PrefabInstance:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_Modification:
+    m_TransformParent: {fileID: 2730232521377132808}
+    m_Modifications:
+    - target: {fileID: 1723151111827507803, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+      propertyPath: m_RootOrder
+      value: 4
+      objectReference: {fileID: 0}
+    - target: {fileID: 1723151111827507803, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+      propertyPath: m_LocalPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1723151111827507803, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+      propertyPath: m_LocalPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1723151111827507803, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+      propertyPath: m_LocalPosition.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1723151111827507803, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+      propertyPath: m_LocalRotation.w
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 1723151111827507803, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+      propertyPath: m_LocalRotation.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1723151111827507803, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+      propertyPath: m_LocalRotation.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1723151111827507803, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+      propertyPath: m_LocalRotation.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1723151111827507803, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1723151111827507803, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1723151111827507803, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 1723151111827507807, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+      propertyPath: m_Name
+      value: FollowSoulEffect
+      objectReference: {fileID: 0}
+    - target: {fileID: 1723151111827507807, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+      propertyPath: m_IsActive
+      value: 0
+      objectReference: {fileID: 0}
+    m_RemovedComponents: []
+  m_SourcePrefab: {fileID: 100100000, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+--- !u!114 &2061548984477852820 stripped
+MonoBehaviour:
+  m_CorrespondingSourceObject: {fileID: 3300381806182711281, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+  m_PrefabInstance: {fileID: 3553718495943334757}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 0}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: a7ca44b9cabcdeb4bb198cc532b04e86, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+--- !u!1 &2790126111997635467 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 1723151111081767150, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+  m_PrefabInstance: {fileID: 3553718495943334757}
+  m_PrefabAsset: {fileID: 0}
+--- !u!4 &2790126112879694142 stripped
+Transform:
+  m_CorrespondingSourceObject: {fileID: 1723151111827507803, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+  m_PrefabInstance: {fileID: 3553718495943334757}
+  m_PrefabAsset: {fileID: 0}
 --- !u!1001 &7464584808883890403
 PrefabInstance:
   m_ObjectHideFlags: 0

+ 2 - 0
ActionTowerDefense/Assets/Resources/Prefab/FX/FollowSoulEffect.prefab

@@ -156744,6 +156744,7 @@ MonoBehaviour:
     repelValue: 100
   destroyTime: 5
   characters: []
+  isTransfiguration: 1
 --- !u!54 &2865685094821105927
 Rigidbody:
   m_ObjectHideFlags: 0
@@ -156831,6 +156832,7 @@ MonoBehaviour:
     repelValue: 100
   destroyTime: 5
   characters: []
+  isTransfiguration: 0
 --- !u!54 &923046814478230668
 Rigidbody:
   m_ObjectHideFlags: 0

+ 10 - 1
ActionTowerDefense/Assets/Resources/Prefab/Transfiguration/Trans_Invisible.prefab

@@ -1214,7 +1214,7 @@ MonoBehaviour:
   angle: 0
   soulsNumber: 0
   rotateSpeed: 90
-  soul: {fileID: 1723151111827507807, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+  soul: {fileID: 17818087743600479}
   eSpirits: {fileID: 0}
   soulsList: []
   distance: 1.5
@@ -1286,8 +1286,17 @@ PrefabInstance:
       propertyPath: m_IsActive
       value: 0
       objectReference: {fileID: 0}
+    - target: {fileID: 4201428945599059759, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+      propertyPath: attackInfo.damage
+      value: 99999999
+      objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_SourcePrefab: {fileID: 100100000, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+--- !u!1 &17818087743600479 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 1723151111081767150, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}
+  m_PrefabInstance: {fileID: 1717720538502236081}
+  m_PrefabAsset: {fileID: 0}
 --- !u!4 &17818087937920490 stripped
 Transform:
   m_CorrespondingSourceObject: {fileID: 1723151111827507803, guid: a956ce2c24a9a8b4b98cbf27ef623367, type: 3}

+ 52 - 26
ActionTowerDefense/Assets/Scripts/Spirits/SoulBoom.cs

@@ -12,43 +12,49 @@ public class SoulBoom : MonoBehaviour
     public AttackInfo attackInfo;
     public float destroyTime;
     public List<Character> characters = new List<Character>();
+    public bool isTransfiguration;
     private void Update()
     {
         time += Time.deltaTime;
+
         if (time >= boomTime)
         {
-            if (!isBoom)
+            if (time < boomTime + 0.1)
             {
-                
-                for(int i = 0; i < characters.Count; i++)
+                GetComponent<Collider>().enabled = true;
+            }
+            else
+            {
+                if (!isBoom)
                 {
-                    if (characters[i].state == CharacterState.Die)
-                    {
-                        continue;
-                    }
 
-                    Vector3 target;
-                    if (characters[i].transform.position.x > transform.position.x)
-                    {
-                        target = attackInfo.attackDir;
-                    }
-                    else
+                    for (int i = 0; i < characters.Count; i++)
                     {
-                        target = new Vector3(-attackInfo.attackDir.x, attackInfo.attackDir.y,
-                            attackInfo.attackDir.z);
+                        if (characters[i].state == CharacterState.Die)
+                        {
+                            continue;
+                        }
+
+                        Vector3 target;
+                        if (characters[i].transform.position.x > transform.position.x)
+                        {
+                            target = attackInfo.attackDir;
+                        }
+                        else
+                        {
+                            target = new Vector3(-attackInfo.attackDir.x, attackInfo.attackDir.y,
+                                attackInfo.attackDir.z);
+                        }
+                        characters[i].BeHit
+                            (attackInfo.damage, target * attackInfo.force,
+                            attackInfo.changeHurt, attackInfo.repelValue);
+
+
                     }
-                    characters[i].BeHit
-                        (attackInfo.damage, target * attackInfo.force,
-                        attackInfo.changeHurt, attackInfo.repelValue);
+
                     isBoom = true;
                 }
-
             }
-            
-        }
-        else if(time >= boomTime - 0.01f)
-        {
-            GetComponent<Collider>().enabled = true;
         }
         if (time >= destroyTime)
         {
@@ -57,19 +63,39 @@ public class SoulBoom : MonoBehaviour
     }
     private void OnTriggerEnter(Collider other)
     {
-        if ((other.gameObject.layer == 6 || other.gameObject.layer == 7)
+        if (!isTransfiguration && (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);
+            }
+        }
+        
+        if (isTransfiguration && other.gameObject.layer == 8
             && 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)
+        if (!isTransfiguration && (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);
+            }
+        }
+        if (isTransfiguration && other.gameObject.layer == 8
             && other.name == "BodyCollider")
         {
             Character character = other.GetComponentInParent<Character>();

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

@@ -28,7 +28,7 @@ public class SoulFollowEffect : MonoBehaviour
         {
             for (int i = 0; i < eSpirits.followNumber; i++)
             {
-                GameObject newSoul = Instantiate(soul.transform.GetChild(0).gameObject);
+                GameObject newSoul = Instantiate(soul.gameObject);
                 newSoul.transform.parent = transform;
                 newSoul.SetActive(false);
                 soulsList.Add(newSoul);
@@ -78,21 +78,21 @@ public class SoulFollowEffect : MonoBehaviour
     }
     public void Boom()
     {
-        GameObject boomSoul = Instantiate(soul.transform.GetChild(1).gameObject);
+        GameObject boomSoul = Instantiate(soulBoom.gameObject);
         boomSoul.transform.position = transform.position;
         if (isTransfiguration)
         {
             boomSoul.transform.parent = transform;
             boomSoul.transform.GetChild(0).GetChild(2).gameObject.SetActive(false);
         }
-
+        
         boomSoul.SetActive(true);
     }
     public void ShowSouls(int newNumber)
     {
         if(soulsList.Count < newNumber)
         {
-            GameObject newSoul = Instantiate(soul.transform.GetChild(0).gameObject);
+            GameObject newSoul = Instantiate(soul.gameObject);
             newSoul.transform.parent = transform;
             newSoul.SetActive(false);
             soulsList.Add(newSoul);