SZAND\msx_2 1 năm trước cách đây
mục cha
commit
a91d4d249b

+ 5 - 0
ActionTowerDefense/Assets/Scripts/Bullet.cs

@@ -111,6 +111,11 @@ public class Bullet : MonoBehaviour
                         default:
                             break;
                     }
+                    if (toFloat)
+                    {
+                        toFloat = false;
+                        hitTrigger.owner.GetComponent<MoveCharacter>().FloatStateOn();
+                    }
                 }
             }
         }

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

@@ -188,7 +188,6 @@ public class Character : MonoBehaviour
 
     public virtual void AttackShootEvent(int attackId, int shootId)
     {
-        print(1);
         AttackInfo attackInfo;
         if (attackId == 1)
         {

+ 8 - 0
ActionTowerDefense/Assets/Scripts/CharacterColliders.cs

@@ -18,11 +18,19 @@ public class CharacterColliders : MonoBehaviour
 
     public void Attack1ShootEvent(int shootId)
     {
+        if (owner == null)
+        {
+            owner = GetComponentInParent<Character>();
+        }
         owner.AttackShootEvent(1, shootId);
     }
 
     public void Attack2ShootEvent(int shootId)
     {
+        if (owner == null)
+        {
+            owner = GetComponentInParent<Character>();
+        }
         owner.AttackShootEvent(2, shootId);
     }
 }