From 115f77bda0246a00f6e17469685c67746bdbd29d Mon Sep 17 00:00:00 2001 From: nirav Date: Sat, 12 Dec 2020 07:18:36 +0000 Subject: Initial commit --- Assets/Scripts/GunPickup.cs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 Assets/Scripts/GunPickup.cs (limited to 'Assets/Scripts/GunPickup.cs') 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(); + } + + 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().canShoot = true; + GameObject.Destroy(gameObject); + } + } +} -- cgit v1.2.3