Newer
Older
TheVengeance-Project-IADE-Unity2D / Assets / Scripts / NPC / InteractableNPC.cs
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using Ink.Runtime;
  6. public class InteractableNPC : NPCController, IInteractable
  7. {
  8. [Header("Display message on interact")]
  9. protected DisplayMessage displayMessage;
  10. [Header("Chat Icon Logo")]
  11. [SerializeField] protected GameObject chatIconObj;
  12. protected Story currentStory; // Store the story here
  13. protected DialogueManager dialogueManager;
  14. public Story CurrentStory => currentStory;
  15. public DialogueManager DialogueManager => dialogueManager;
  16. public GameObject dialogueIcon => chatIconObj;
  17. protected override void Awake()
  18. {
  19. base.Awake();
  20. }
  21. protected override void Start()
  22. {
  23. base.Start();
  24. AddObserver(npcManager.DialogueManager);
  25. dialogueManager = DialogueManager.Instance;
  26. }
  27. public string GetDisplayMessage(DisplayMessage message)
  28. {
  29. return message.GetFormattedMessage(InputManager.GetKey(InputAction.Interact).ToString());
  30. }
  31. protected override void AnimationController()
  32. {
  33. base.AnimationController();
  34. }
  35. public virtual void OnInteract()
  36. {
  37. }
  38. }