Newer
Older
TheVengeance-Project-IADE-Unity2D / Assets / Scripts / NPC / InteractableNPC.cs
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Ink.Runtime;

public abstract class InteractableNPC : NPCController, IInteractable
{
    [Header("Display message on interact")]
    protected DisplayMessage displayMessage;

    [Header("Chat Icon Logo")]
    [SerializeField] protected GameObject chatIconObj;

    protected Story currentStory; // Store the story here
    protected DialogueManager dialogueManager;

    public Story CurrentStory => currentStory;
    public DialogueManager DialogueManager => dialogueManager;

    public GameObject dialogueIcon => chatIconObj;

    protected override void Awake()
    {
        base.Awake();
    }

    protected override void Start()
    {
        base.Start();
        AddObserver(npcManager.DialogueManager);
        dialogueManager = DialogueManager.Instance;
    }

    public string GetDisplayMessage(DisplayMessage message)
    {
        return message.GetFormattedMessage(InputManager.GetKey(InputAction.Interact).ToString());
    }

    protected override void AnimationController()
    {
        base.AnimationController();
    }

    public abstract void OnInteract();
}