namespace Rokid.UXR.Interaction { using System; using System.Collections.Generic; public struct InteractableStateChangeArgs { public InteractableState PreviousState { get; } public InteractableState NewState { get; } public InteractableStateChangeArgs( InteractableState previousState, InteractableState newState) { PreviousState = previousState; NewState = newState; } } /// /// An IInteractableView defines the view for an object that can be /// interacted with. /// public interface IInteractableView { object Data { get; } InteractableState State { get; } event Action WhenStateChanged; int MaxInteractors { get; } int MaxSelectingInteractors { get; } IEnumerable InteractorViews { get; } IEnumerable SelectingInteractorViews { get; } event Action WhenInteractorViewAdded; event Action WhenInteractorViewRemoved; event Action WhenSelectingInteractorViewAdded; event Action WhenSelectingInteractorViewRemoved; } /// /// An object that can be interacted with, an IInteractable can, in addition to /// an IInteractableView, be enabled or disabled. /// public interface IInteractable : IInteractableView { void Enable(); void Disable(); new int MaxInteractors { get; set; } new int MaxSelectingInteractors { get; set; } void RemoveInteractorByIdentifier(int id); } }