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); } } }