37 lines
980 B
C#
37 lines
980 B
C#
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<UIHandler>().showMessage("SUCCESS;You got a quest from this NPC!");
|
|
GameObject.Find("QuestLog").GetComponent<QuestLog>().addQuest();
|
|
hasQuest = false;
|
|
}
|
|
else
|
|
{
|
|
GameObject.Find("UIHandler").GetComponent<UIHandler>().showMessage("ERROR;You already got the quest from this NPC!");
|
|
}
|
|
GameObject.Find("QuestLog").GetComponent<QuestLog>().removeQuests();
|
|
}
|
|
}
|
|
} |