summaryrefslogtreecommitdiff
path: root/Assets/Scripts/GunPickup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts/GunPickup.cs')
-rwxr-xr-xAssets/Scripts/GunPickup.cs27
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);
+ }
+ }
+}