diff options
author | marcinzelent <zelent.marcin@gmail.com> | 2019-04-27 12:20:18 +0200 |
---|---|---|
committer | marcinzelent <zelent.marcin@gmail.com> | 2019-04-27 12:20:18 +0200 |
commit | b91f71896693ec1525c2a31b42278e32ba901a06 (patch) | |
tree | 874e57cf6c3a5edf309c118d7787602a1a8b0f28 /nGJ2019/Assets/Scripts/DragonMovement.cs | |
parent | b1a279b551e2127ff9f530b205f2e1590ae51e9f (diff) | |
parent | 5b4381a1993c4a67facc2d5d55b1d5c94f284ca7 (diff) |
Merge
Diffstat (limited to 'nGJ2019/Assets/Scripts/DragonMovement.cs')
-rw-r--r-- | nGJ2019/Assets/Scripts/DragonMovement.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nGJ2019/Assets/Scripts/DragonMovement.cs b/nGJ2019/Assets/Scripts/DragonMovement.cs index 04f1c3a..4ba179d 100644 --- a/nGJ2019/Assets/Scripts/DragonMovement.cs +++ b/nGJ2019/Assets/Scripts/DragonMovement.cs @@ -12,6 +12,8 @@ public class DragonMovement : MonoBehaviour public float horizontalBound = 6f; public float verticalBound = 4f; + public HealthBar healthBar; + private SwarmSystem swarm; private enum State {normal, swirl, slim, spread}; @@ -198,4 +200,14 @@ public class DragonMovement : MonoBehaviour Gizmos.DrawWireCube(Vector3.zero, new Vector3(2*horizontalBound, 2*verticalBound, 0)); } + void OnTriggerEnter(Collider other) + { + EnemyCollider enemy = other.gameObject.GetComponent<EnemyCollider>(); + if(enemy != null) + { + Debug.Log(enemy.type == ObstacleType.alfa ? "alfa hit" : "beta hit"); + healthBar.health--; + } + } + }
\ No newline at end of file |