Files
ClickRPG/Assets/Scripts/NPC.cs

41 lines
925 B
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;
// 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)
{
2025-10-06 15:32:09 +01:00
Debug.Log($"Welcome to my shop, {charName}!");
2025-10-04 12:25:29 +01:00
}
else if (npcType == NPCType.Villager)
{
dialogueController.ChangeDialogue(dialogue);
dialogueController.PlayDialogue();
}
else if (npcType == NPCType.Guard)
{
2025-10-06 15:32:09 +01:00
Debug.Log($"Stay out of trouble, citizen. I'm {charName}, a guard.");
2025-10-04 12:25:29 +01:00
}
else
{
2025-10-06 15:32:09 +01:00
Debug.Log($"Greetings from {charName}!");
2025-10-04 12:25:29 +01:00
}
}
}