namespace VRTK.Prefabs.Interactions.Interactables.Grab.Action { using UnityEngine; using Malimbe.MemberChangeMethod; using Malimbe.XmlDocumentationAttribute; using Malimbe.PropertySerializationAttribute; using Zinnia.Event.Proxy; using Zinnia.Data.Attribute; using Zinnia.Tracking.Collision.Active.Event.Proxy; /// /// Describes an action to perform when a Grab Process is executed. /// public class GrabInteractableAction : MonoBehaviour { #region Input Settings /// /// The input for the grab action. /// [Serialized] [field: Header("Input Settings"), DocumentedByXml, Restricted] public ActiveCollisionConsumerEventProxyEmitter InputActiveCollisionConsumer { get; protected set; } /// /// The input for the grab action. /// [Serialized] [field: DocumentedByXml, Restricted] public GameObjectEventProxyEmitter InputGrabReceived { get; protected set; } /// /// The input for the grab action. /// [Serialized] [field: DocumentedByXml, Restricted] public GameObjectEventProxyEmitter InputUngrabReceived { get; protected set; } /// /// The input for any pre setup on grab. /// [Serialized] [field: DocumentedByXml, Restricted] public GameObjectEventProxyEmitter InputGrabSetup { get; protected set; } /// /// The input for any post reset on ungrab. /// [Serialized] [field: DocumentedByXml, Restricted] public GameObjectEventProxyEmitter InputUngrabReset { get; protected set; } #endregion /// /// The internal setup for the grab action. /// public GrabInteractableConfigurator GrabSetup { get; set; } /// /// Notifies that the Interactable is being grabbed. /// /// The grabbing object. public virtual void NotifyGrab(GameObject data) { GrabSetup.NotifyGrab(data); } /// /// Notifies that the Interactable is no longer being grabbed. /// /// The previous grabbing object. public virtual void NotifyUngrab(GameObject data) { GrabSetup.NotifyUngrab(data); } /// /// Called after has been changed. /// [CalledAfterChangeOf(nameof(GrabSetup))] protected virtual void OnAfterGrabSetupChange() { } } }