summaryrefslogtreecommitdiff
path: root/Assets/Scripts/GunPickup.cs
blob: b97d9ebc7f3938a8772ce6f4fd3fbfa6f4c7d38a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);
        }        
    }
}