diff options
author | nirav <nirav@airmail.cc> | 2020-12-12 07:18:36 +0000 |
---|---|---|
committer | nirav <nirav@airmail.cc> | 2020-12-12 07:18:36 +0000 |
commit | 115f77bda0246a00f6e17469685c67746bdbd29d (patch) | |
tree | 4bbea1e59109bb1d1fddc71736f89289bab03073 /Assets/Scripts/GunPickup.cs | |
download | 01-master.tar.gz 01-master.zip |
Diffstat (limited to 'Assets/Scripts/GunPickup.cs')
-rwxr-xr-x | Assets/Scripts/GunPickup.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Assets/Scripts/GunPickup.cs b/Assets/Scripts/GunPickup.cs new file mode 100755 index 0000000..b97d9eb --- /dev/null +++ b/Assets/Scripts/GunPickup.cs @@ -0,0 +1,27 @@ +using UnityEngine; +using System.Collections; + +public class GunPickup : MonoBehaviour +{ + DialogueScript dialogueScript; + + void Start () + { + dialogueScript = GameObject.FindGameObjectWithTag("DialogueSystem").GetComponent<DialogueScript>(); + } + + void Update () + { + + } + + void OnTriggerEnter2D(Collider2D col) + { + if (col.tag == "PlayerCollider") + { + dialogueScript.ShowMultiDialogue("You picked up a gun, Now shoot;\nHello\najshgdkadh\nahksjdhasd"); + GameObject.FindGameObjectWithTag("Player").GetComponentInChildren<PlayerShootingScript>().canShoot = true; + GameObject.Destroy(gameObject); + } + } +} |