Files
ClickRPG/Assets/Scripts/NPC.cs

44 lines
1.0 KiB
C#
Raw Normal View History

2025-10-04 12:25:29 +01:00
using EasyTalk.Controller;
using UnityEngine;
public class NPC : Character
{
public enum NPCType { Villager, Merchant, Guard }
public NPCType npcType;
public float speed = 5f;
public string npcName = "NPC";
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void Interact()
{
if (npcType == NPCType.Merchant)
{
Debug.Log($"Welcome to my shop, {npcName}!");
}
else if (npcType == NPCType.Villager)
{
//Debug.Log($"Hello there! I'm {npcName}, a humble villager.");
dialogueController.ChangeDialogue(dialogue);
dialogueController.PlayDialogue();
}
else if (npcType == NPCType.Guard)
{
Debug.Log($"Stay out of trouble, citizen. I'm {npcName}, a guard.");
}
else
{
Debug.Log($"Greetings from {npcName}!");
}
}
}