using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Assets.Scripts { public class NPC : MonoBehaviour { bool hasQuest = true; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public void interact() { if (hasQuest) { GameObject.Find("UIHandler").GetComponent().showMessage("SUCCESS;You got a quest from this NPC!"); GameObject.Find("QuestLog").GetComponent().addQuest(); hasQuest = false; } else { GameObject.Find("UIHandler").GetComponent().showMessage("ERROR;You already got the quest from this NPC!"); } GameObject.Find("QuestLog").GetComponent().removeQuests(); } } }