// Use this for initialization void Start() { controller = this.GetComponentInChildren <playerContoller> (); anim = GetComponent <Animator>(); caster = this.GetComponentInChildren <SpellCast> (); questManager = this.GetComponentInChildren <QuestManager> (); }
void OnTriggerExit(Collider other) { if (other.gameObject.tag == "Player" && player != null) { questManager.ClearAlert(); player = null; controller = null; caster = null; questManager = null; } }
void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player" && player == null) { player = other.gameObject; questManager = player.GetComponentInChildren <QuestManager> (); controller = player.GetComponentInChildren <playerContoller> (); caster = player.GetComponentInChildren <SpellCast> (); questManager.FillAlert("Press 'T' to start conversation"); } }