Bladeren bron

加入眩晕状态

SZAND\msx_2 1 jaar geleden
bovenliggende
commit
ffa2433d99

+ 3 - 0
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Arrow.prefab

@@ -963,6 +963,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: c1bedfb340186164dbac1499b49b879e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  HitCols:
+  - {fileID: 1190225091429982147}
+  - {fileID: 5388987656270167698}
   cookNum: 3
   cooks: []
   mecanim: {fileID: 3354085511906294621}

+ 11 - 0
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Giant.prefab

@@ -426,6 +426,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: c1bedfb340186164dbac1499b49b879e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  HitCols:
+  - {fileID: 4480734502875862885}
+  - {fileID: 2460330936527559963}
   cookNum: 10
   cooks: []
   mecanim: {fileID: 7573527827155227431}
@@ -469,6 +472,7 @@ MonoBehaviour:
   invincibleTime: 0
   totalInvincibleTime: 0
   targetCharacter: {fileID: 0}
+  beTargetCharacter: []
   searchTrigger: {fileID: 2932762729738363159}
   targetTypes: 0400000005000000
   canHitFly: 0
@@ -506,6 +510,9 @@ MonoBehaviour:
   totalSummonTime: 0.5
   searchState: 0
   attackDistance: 3
+  maxAttackDis: 0
+  minAttackDis: 0
+  needToChange: 0
   canFly: 0
   flyHeight: 0
   flyUpSpeed: 10
@@ -574,7 +581,11 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  isCook: 0
   trigObjList: []
+  needToChange: 0
+  maxLen: 0
+  minLen: 0
 --- !u!65 &826799689842861252
 BoxCollider:
   m_ObjectHideFlags: 0

+ 11 - 0
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Sword.prefab

@@ -46,7 +46,11 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  isCook: 0
   trigObjList: []
+  needToChange: 0
+  maxLen: 0
+  minLen: 0
 --- !u!65 &6745998926352348214
 BoxCollider:
   m_ObjectHideFlags: 0
@@ -165,6 +169,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: c1bedfb340186164dbac1499b49b879e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  HitCols:
+  - {fileID: 6526817785665782971}
+  - {fileID: 8769150919382874379}
   cookNum: 6
   cooks: []
   mecanim: {fileID: 5617185463097218335}
@@ -208,6 +215,7 @@ MonoBehaviour:
   invincibleTime: 0
   totalInvincibleTime: 0
   targetCharacter: {fileID: 0}
+  beTargetCharacter: []
   searchTrigger: {fileID: 5104552355235513707}
   targetTypes: 0400000005000000
   canHitFly: 0
@@ -245,6 +253,9 @@ MonoBehaviour:
   totalSummonTime: 0.5
   searchState: 0
   attackDistance: 1.5
+  maxAttackDis: 0
+  minAttackDis: 0
+  needToChange: 0
   canFly: 0
   flyHeight: 0
   flyUpSpeed: 10

+ 7 - 0
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Assassin.prefab

@@ -46,6 +46,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  isCook: 0
   trigObjList: []
   needToChange: 0
   maxLen: 0
@@ -216,6 +217,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 7475a7d33f657b146a4994b1e02710ad, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  HitCols:
+  - {fileID: 6526817785665782971}
+  - {fileID: 8769150919382874379}
   cookNum: 6
   cooks: []
   mecanim: {fileID: 5617185463097218335}
@@ -296,6 +300,9 @@ MonoBehaviour:
   jumpSpeed: 9
   searchState: 0
   attackDistance: 1.5
+  maxAttackDis: 0
+  minAttackDis: 0
+  needToChange: 0
   canFly: 0
   flyHeight: 0
   flyUpSpeed: 10

+ 9 - 2
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Cook.prefab

@@ -336,6 +336,7 @@ MonoBehaviour:
   effect: {fileID: 2123904437201259524, guid: 24cf2b33715a9e04b9aabcb789c31067, type: 3}
   activeAniTime: 1.3
   larger: 1.2
+  target: {fileID: 0}
   searchtrigger: {fileID: 2932762729738363159}
   lockEffect: {fileID: 2123904437201259524, guid: 24cf2b33715a9e04b9aabcb789c31067, type: 3}
   cookTime: 2
@@ -808,6 +809,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 7475a7d33f657b146a4994b1e02710ad, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  HitCols:
+  - {fileID: 4480734502875862885}
+  - {fileID: 2460330936527559963}
   cookNum: 10
   cooks: []
   mecanim: {fileID: 7573527827155227431}
@@ -889,6 +893,9 @@ MonoBehaviour:
   jumpSpeed: 9
   searchState: 0
   attackDistance: 1.5
+  maxAttackDis: 0
+  minAttackDis: 0
+  needToChange: 0
   canFly: 0
   flyHeight: 0
   flyUpSpeed: 10
@@ -1058,8 +1065,8 @@ BoxCollider:
   m_IsTrigger: 1
   m_Enabled: 1
   serializedVersion: 2
-  m_Size: {x: 0, y: 0, z: 0}
-  m_Center: {x: 0, y: 0, z: 0}
+  m_Size: {x: 5, y: 10, z: 0}
+  m_Center: {x: 0, y: 3, z: 0}
 --- !u!1 &6888705005009706503
 GameObject:
   m_ObjectHideFlags: 0

+ 7 - 0
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Float.prefab

@@ -576,6 +576,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  isCook: 0
   trigObjList: []
   needToChange: 0
   maxLen: 0
@@ -1001,6 +1002,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 7475a7d33f657b146a4994b1e02710ad, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  HitCols:
+  - {fileID: 5388987656270167698}
+  - {fileID: 1190225091429982147}
   cookNum: 3
   cooks: []
   mecanim: {fileID: 3354085511906294621}
@@ -1095,6 +1099,9 @@ MonoBehaviour:
   jumpSpeed: 10
   searchState: 0
   attackDistance: 10
+  maxAttackDis: 0
+  minAttackDis: 0
+  needToChange: 0
   canFly: 1
   flyHeight: 0
   flyUpSpeed: 10

+ 7 - 0
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Invisible.prefab

@@ -46,6 +46,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  isCook: 0
   trigObjList: []
   needToChange: 0
   maxLen: 0
@@ -218,6 +219,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 7475a7d33f657b146a4994b1e02710ad, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  HitCols:
+  - {fileID: 6526817785665782971}
+  - {fileID: 8769150919382874379}
   cookNum: 0
   cooks: []
   mecanim: {fileID: 4509017029252731830}
@@ -296,6 +300,9 @@ MonoBehaviour:
   jumpSpeed: 10
   searchState: 0
   attackDistance: 10
+  maxAttackDis: 0
+  minAttackDis: 0
+  needToChange: 0
   canFly: 1
   flyHeight: 0
   flyUpSpeed: 10

+ 3 - 0
ActionTowerDefense/Assets/Resources/Prefab/Enemy_Arrow.prefab

@@ -963,6 +963,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 7475a7d33f657b146a4994b1e02710ad, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  HitCols:
+  - {fileID: 5388987656270167698}
+  - {fileID: 1190225091429982147}
   cookNum: 3
   cooks: []
   mecanim: {fileID: 3354085511906294621}

+ 11 - 0
ActionTowerDefense/Assets/Resources/Prefab/Enemy_Giant.prefab

@@ -426,6 +426,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 7475a7d33f657b146a4994b1e02710ad, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  HitCols:
+  - {fileID: 4480734502875862885}
+  - {fileID: 2460330936527559963}
   cookNum: 10
   cooks: []
   mecanim: {fileID: 7573527827155227431}
@@ -469,6 +472,7 @@ MonoBehaviour:
   invincibleTime: 0
   totalInvincibleTime: 0
   targetCharacter: {fileID: 0}
+  beTargetCharacter: []
   searchTrigger: {fileID: 2932762729738363159}
   targetTypes: 010000000200000003000000
   canHitFly: 0
@@ -505,6 +509,9 @@ MonoBehaviour:
   jumpSpeed: 10
   searchState: 0
   attackDistance: 3
+  maxAttackDis: 0
+  minAttackDis: 0
+  needToChange: 0
   canFly: 0
   flyHeight: 0
   flyUpSpeed: 10
@@ -597,7 +604,11 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  isCook: 0
   trigObjList: []
+  needToChange: 0
+  maxLen: 0
+  minLen: 0
 --- !u!65 &826799689842861252
 BoxCollider:
   m_ObjectHideFlags: 0

+ 11 - 0
ActionTowerDefense/Assets/Resources/Prefab/Enemy_Sword.prefab

@@ -221,6 +221,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 7475a7d33f657b146a4994b1e02710ad, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  HitCols:
+  - {fileID: 3917432747505904452}
+  - {fileID: 4960124152152785005}
   cookNum: 6
   cooks: []
   mecanim: {fileID: 5617185463097218335}
@@ -264,6 +267,7 @@ MonoBehaviour:
   invincibleTime: 0
   totalInvincibleTime: 0
   targetCharacter: {fileID: 0}
+  beTargetCharacter: []
   searchTrigger: {fileID: 428784489592146076}
   targetTypes: 010000000300000002000000
   canHitFly: 0
@@ -300,6 +304,9 @@ MonoBehaviour:
   jumpSpeed: 9
   searchState: 0
   attackDistance: 1.5
+  maxAttackDis: 0
+  minAttackDis: 0
+  needToChange: 0
   canFly: 0
   flyHeight: 0
   flyUpSpeed: 10
@@ -678,7 +685,11 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 2437299196472462361}
+  isCook: 0
   trigObjList: []
+  needToChange: 0
+  maxLen: 0
+  minLen: 0
 --- !u!65 &988946674126968617
 BoxCollider:
   m_ObjectHideFlags: 0

+ 9 - 0
ActionTowerDefense/Assets/Resources/Prefab/Player.prefab

@@ -759,7 +759,11 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 0b46e3a90d8fc304caef18f1c373478c, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  HitCols:
+  - {fileID: 5569876744729591823}
+  - {fileID: 1367816017394770223}
   cookNum: 10
+  cooks: []
   mecanim: {fileID: 6843453365888964567}
   meshRenderer: {fileID: 0}
   ani: {fileID: 6197716555580445942}
@@ -815,6 +819,7 @@ MonoBehaviour:
   invincibleTime: 0
   totalInvincibleTime: 0.5
   targetCharacter: {fileID: 0}
+  beTargetCharacter: []
   searchTrigger: {fileID: 2246792914537570827}
   targetTypes: 0400000005000000
   canHitFly: 1
@@ -1539,7 +1544,11 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  isCook: 0
   trigObjList: []
+  needToChange: 0
+  maxLen: 0
+  minLen: 0
 --- !u!65 &1773367177312460232
 BoxCollider:
   m_ObjectHideFlags: 0

+ 11 - 0
ActionTowerDefense/Assets/Resources/Prefab/Spirits_Assassin.prefab

@@ -46,7 +46,11 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  isCook: 0
   trigObjList: []
+  needToChange: 0
+  maxLen: 0
+  minLen: 0
 --- !u!65 &6745998926352348214
 BoxCollider:
   m_ObjectHideFlags: 0
@@ -201,6 +205,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: c1bedfb340186164dbac1499b49b879e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  HitCols:
+  - {fileID: 6526817785665782971}
+  - {fileID: 8769150919382874379}
   cookNum: 6
   cooks: []
   mecanim: {fileID: 5617185463097218335}
@@ -244,6 +251,7 @@ MonoBehaviour:
   invincibleTime: 0
   totalInvincibleTime: 0
   targetCharacter: {fileID: 0}
+  beTargetCharacter: []
   searchTrigger: {fileID: 5104552355235513707}
   targetTypes: 0400000005000000
   canHitFly: 0
@@ -281,6 +289,9 @@ MonoBehaviour:
   totalSummonTime: 0.5
   searchState: 0
   attackDistance: 1.5
+  maxAttackDis: 0
+  minAttackDis: 0
+  needToChange: 0
   canFly: 0
   flyHeight: 0
   flyUpSpeed: 10

+ 7 - 0
ActionTowerDefense/Assets/Resources/Prefab/Spirits_Float.prefab

@@ -576,6 +576,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  isCook: 0
   trigObjList: []
   needToChange: 0
   maxLen: 0
@@ -979,6 +980,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: c1bedfb340186164dbac1499b49b879e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  HitCols:
+  - {fileID: 5388987656270167698}
+  - {fileID: 1190225091429982147}
   cookNum: 3
   cooks: []
   mecanim: {fileID: 3354085511906294621}
@@ -1074,6 +1078,9 @@ MonoBehaviour:
   totalSummonTime: 0.5
   searchState: 0
   attackDistance: 10
+  maxAttackDis: 0
+  minAttackDis: 0
+  needToChange: 0
   canFly: 1
   flyHeight: 0
   flyUpSpeed: 10

+ 7 - 0
ActionTowerDefense/Assets/Resources/Prefab/Spirits_Invisible.prefab

@@ -46,6 +46,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   owner: {fileID: 0}
+  isCook: 0
   trigObjList: []
   needToChange: 0
   maxLen: 0
@@ -195,6 +196,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: c1bedfb340186164dbac1499b49b879e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  HitCols:
+  - {fileID: 6526817785665782971}
+  - {fileID: 8769150919382874379}
   cookNum: 0
   cooks: []
   mecanim: {fileID: 5617185463097218335}
@@ -275,6 +279,9 @@ MonoBehaviour:
   totalSummonTime: 0.5
   searchState: 0
   attackDistance: 1.5
+  maxAttackDis: 0
+  minAttackDis: 0
+  needToChange: 0
   canFly: 0
   flyHeight: 0
   flyUpSpeed: 10

+ 2 - 0
ActionTowerDefense/Assets/Scripts/Character.cs

@@ -47,6 +47,8 @@ public enum HpUpType
 
 public class Character : MonoBehaviour
 {
+    public GameObject[] HitCols;
+
     public int cookNum;   //콘隣뜩�눔
     public List<GameObject> cooks;  //넜법强소돨눔
 

+ 18 - 0
ActionTowerDefense/Assets/Scripts/Demonic.cs

@@ -378,6 +378,8 @@ public class Demonic : MoveCharacter
                 vel.x = vel.x * (1 - decelerationRatio * Time.deltaTime);
                 rb.velocity = vel;
                 break;
+            case CharacterState.Coma:
+                break;
             case CharacterState.Attack:
                 if (attackTime <= 0)
                 {
@@ -421,6 +423,12 @@ public class Demonic : MoveCharacter
                 break;
             case CharacterState.Hurt:
                 break;
+            case CharacterState.Coma:
+                foreach(GameObject i in HitCols)
+                {
+                    i.SetActive(true);
+                }
+                break;
             case CharacterState.Attack:
                 aniCollider.Play("NotAttack", 1, 0);
                 break;
@@ -466,6 +474,16 @@ public class Demonic : MoveCharacter
                 hurtKeepTime = minHurtKeepTime;
                 //ani.Play("Invincible", 2, 0);
                 break;
+            case CharacterState.Coma:
+                //ani.Play("Coma", 0, 0);
+                ani.Play("idle", 0, 0);
+                aniCollider.Play("Idle", 0, 0);
+                foreach (GameObject i in HitCols)
+                {
+                    i.SetActive(false);
+                }
+                rb.velocity = Vector3.zero;
+                break;
             case CharacterState.Attack:
                 break;
             case CharacterState.Die:

+ 12 - 1
ActionTowerDefense/Assets/Scripts/Enemy.cs

@@ -578,6 +578,10 @@ public class Enemy : MoveCharacter
             case CharacterState.Weak:
                 break;
             case CharacterState.Coma:
+                foreach (GameObject i in HitCols)
+                {
+                    i.SetActive(true);
+                }
                 break;
             case CharacterState.FindPlayer:
                 noOnSearchState = false;
@@ -663,7 +667,14 @@ public class Enemy : MoveCharacter
                 }
                 break;
             case CharacterState.Coma:
-                ani.Play("Coma", 0, 0);
+                //ani.Play("Coma", 0, 0);
+                ani.Play("idle", 0, 0);
+                aniCollider.Play("Idle", 0, 0);
+                rb.velocity = Vector3.zero;
+                foreach (GameObject i in HitCols)
+                {
+                    i.SetActive(false);
+                }
                 break;
             case CharacterState.Attack:
                 break;

+ 18 - 0
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -724,6 +724,8 @@ public class PlayerController : MoveCharacter
                 rb.velocity = vel;
                 CachedPlayerInput();
                 break;
+            case CharacterState.Coma:
+                break;
             case CharacterState.Attack:
                 if (attackTime <= 0)
                 {
@@ -1067,6 +1069,12 @@ public class PlayerController : MoveCharacter
                 break;
             case CharacterState.Hurt:
                 break;
+            case CharacterState.Coma:
+                foreach (GameObject i in HitCols)
+                {
+                    i.SetActive(true);
+                }
+                break;
             case CharacterState.Attack:
                 aniCollider.Play("NotAttack", 1, 0);
                 break;
@@ -1128,6 +1136,16 @@ public class PlayerController : MoveCharacter
                 hurtKeepTime = minHurtKeepTime;
                 //ani.Play("Invincible", 2, 0);
                 break;
+            case CharacterState.Coma:
+                //ani.Play("Coma", 0, 0);
+                ani.Play("idle", 0, 0);
+                aniCollider.Play("Idle", 0, 0);
+                rb.velocity = Vector3.zero;
+                foreach (GameObject i in HitCols)
+                {
+                    i.SetActive(false);
+                }
+                break;
             case CharacterState.Attack:
                 attackTime = totalAttack1Time;
                 break;

+ 14 - 4
ActionTowerDefense/Assets/Scripts/Spirits/ESpirits_Cook.cs

@@ -124,15 +124,17 @@ public class ESpirits_Cook : MonoBehaviour
                     food = target.gameObject;
                     if (food.layer == 7 && !target.isDie)
                     {
-                        //food.GetComponent<Demonic>().ChangeState(CharacterState.Coma);
-                        food.GetComponent<Demonic>().ChangeState(CharacterState.Die);
+                        food.GetComponent<Demonic>().ChangeState(CharacterState.Coma);
+                        food.transform.parent = cook;
+                        //food.GetComponent<Demonic>().ChangeState(CharacterState.Die);
                         //cookKillEffect.SetActive(true);
                         ChangeState(cookState.seize);
                     }
                     else if (food.layer == 6 && !target.isDie)
                     {
-                        //food.GetComponent<PlayerController>().ChangeState(CharacterState.Coma);
-                        food.GetComponent<PlayerController>().ChangeState(CharacterState.Die);
+                        food.GetComponent<PlayerController>().ChangeState(CharacterState.Coma);
+                        food.transform.parent = cook;
+                        //food.GetComponent<PlayerController>().ChangeState(CharacterState.Die);
                         //cookKillEffect.SetActive(true);
                         ChangeState(cookState.seize);
                     }
@@ -144,6 +146,14 @@ public class ESpirits_Cook : MonoBehaviour
             else if (state == cookState.back && target.gameObject.layer == 8)
             {
                 ChangeState(cookState.cook);
+                if (food.layer == 7 && !target.isDie)
+                {
+                    food.GetComponent<Demonic>().ChangeState(CharacterState.Die);
+                }
+                else if (food.layer == 6 && !target.isDie)
+                {
+                    food.GetComponent<PlayerController>().ChangeState(CharacterState.Die);
+                }
             }
         }
     }