slight organization
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Talkable : Interactable
|
||||
{
|
||||
// this is a character or object that will talk upon interaction
|
||||
public Dialogue dialogue;
|
||||
public GameObject talkIndicator;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
talkIndicator.SetActive(false);
|
||||
}
|
||||
|
||||
public override void Interact()
|
||||
{
|
||||
if (!dialogue.isActive)
|
||||
GameManager.Instance.DialogueManager.StartDialogue(dialogue);
|
||||
else
|
||||
GameManager.Instance.DialogueManager.DisplayNextSentence();
|
||||
|
||||
talkIndicator.SetActive(false);
|
||||
}
|
||||
|
||||
public override void MoveInsideRange()
|
||||
{
|
||||
talkIndicator.SetActive(true);
|
||||
}
|
||||
|
||||
public override void MoveOutsideRange()
|
||||
{
|
||||
GameManager.Instance.DialogueManager.EndDialogue();
|
||||
talkIndicator.SetActive(false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user