28 lines
847 B
C#
28 lines
847 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using BITFALL.Hotkey;
|
|
using BITKit;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
|
|
namespace BITFALL.Scene
|
|
{
|
|
public class InteractiveArea : MonoBehaviour,IHotkeyProvider
|
|
{
|
|
[SerializeReference, SubclassSelector] private IReference areaName;
|
|
[SerializeReference, SubclassSelector] private IReference description;
|
|
[SerializeReference,SubclassSelector] private IReference disableDescription;
|
|
[SerializeField] private UnityEvent onPerform = new();
|
|
public virtual string Name => areaName.Value;
|
|
public string Description =>Enabled ? description.Value : disableDescription.Value;
|
|
public object Data { get; set; } = null;
|
|
public bool Enabled => enabled;
|
|
public Action OnPerform => Perform;
|
|
protected virtual void Perform()
|
|
{
|
|
onPerform?.Invoke();
|
|
}
|
|
}
|
|
}
|