using System; using System.Collections.Generic; using SickscoreGames.HUDNavigationSystem; using Sirenix.OdinInspector; using UnityEngine; namespace Cielonos.Core.Interaction { public partial class InteractableObjectBase : MonoBehaviour { public InteractionTrigger interactionTrigger; public HUDNavigationElement navigation; [HideInInspector] public List choices; private void Awake() { choices = new List(); InitializeChoices(); } } public partial class InteractableObjectBase { protected virtual void InitializeChoices() { // Override in derived classes to set up interaction choices } public virtual void EnterTriggerAction() { navigation.showIndicator = true; navigation.useIndicatorDistanceText = true; navigation.indicatorOnscreenDistanceTextFormat = "[E]-Interact"; } public virtual void ExitTriggerAction() { navigation.showIndicator = false; } } #if UNITY_EDITOR public partial class InteractableObjectBase { private void Reset() { Setup(); } [Button("Setup")] private void Setup() { if (interactionTrigger == null) { interactionTrigger = GetComponentInChildren(); interactionTrigger.interactableObject = this; } if (navigation == null) { navigation = GetComponentInChildren(); } } } #endif public class InteractionChoice { public string choiceName; public Action action; public InteractionChoice(string name, Action action) { this.choiceName = name; this.action = action; } } }