Files
ARPGCastleDefence/Assets/Scripts/Interaction/Object.cs

50 lines
1.1 KiB
C#

using ActionRPG.Interfaces;
using Unity.VisualScripting;
using UnityEngine;
using EasyTalk;
using EasyTalk.Nodes;
using EasyTalk.Controller;
using Synty.AnimationBaseLocomotion.Samples;
public class Object : MonoBehaviour, IInteractable
{
[SerializeField] private string objName;
[SerializeField] private bool isinteractable;
[SerializeField] private Dialogue dialogue;
public InteractionType InteractionType => InteractionType.Press;
public void Interact()
{
if(isinteractable)
{
DialogueController.Instance.ChangeDialogue(dialogue);
DialogueController.Instance.PlayDialogue();
}
//Debug.Log("Interacted with: " + objName);
}
public void OnFocused()
{
Debug.Log("Focused on: " + objName);
}
public void OnLostFocus()
{
Debug.Log("Lost focus on: " + objName);
}
// 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()
{
}
}