diff options
author | Jakob Stendahl <JakobS1n@users.noreply.github.com> | 2017-10-14 23:17:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-14 23:17:09 +0200 |
commit | 8b2c937959c99ab2dfbc3eaf9dc5b9c18cf73371 (patch) | |
tree | b775b07054de58f83cd9df41bf43e61b3facfad1 /td/Assets/Scripts/castle.cs | |
parent | 76cf99ade6530bdad81088295fb4cf73f5c5b118 (diff) | |
parent | abe835d1112e4804ce63b7d2fa85f8bd76e3c237 (diff) | |
download | TD-8b2c937959c99ab2dfbc3eaf9dc5b9c18cf73371.tar.gz TD-8b2c937959c99ab2dfbc3eaf9dc5b9c18cf73371.zip |
Merge pull request #4 from JakobS1n/GUI
Gui
Diffstat (limited to 'td/Assets/Scripts/castle.cs')
-rw-r--r-- | td/Assets/Scripts/castle.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/td/Assets/Scripts/castle.cs b/td/Assets/Scripts/castle.cs new file mode 100644 index 0000000..5c8835c --- /dev/null +++ b/td/Assets/Scripts/castle.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Castle : MonoBehaviour { + + private void Update () { + //CheckThing(); + } + + private void CheckThing() { + GameObject[] enemies = GameObject.FindGameObjectsWithTag ("enemy"); + + foreach (var enemy in enemies) { + var distanceToEnemy = Vector3.Distance (transform.position, enemy.transform.position); + if (distanceToEnemy <= 0) { + Debug.Log("INTRUDER!"); + } + } + } + + +} |