namespace VRTK.Prefabs.Helpers.AxisRotator { using UnityEngine; using Malimbe.PropertySerializationAttribute; using Malimbe.XmlDocumentationAttribute; using Malimbe.MemberChangeMethod; using Malimbe.MemberClearanceMethod; using Zinnia.Action; using Zinnia.Data.Attribute; /// /// The public interface for the AxisRotator prefab. /// public class AxisRotatorFacade : MonoBehaviour { #region Axis Settings /// /// The to get the lateral (left/right direction) data from. /// [Serialized] [field: Header("Axis Settings"), DocumentedByXml] public FloatAction LateralAxis { get; set; } /// /// The to get the longitudinal (forward/backward direction) data from. /// [Serialized] [field: DocumentedByXml] public FloatAction LongitudinalAxis { get; set; } #endregion #region Target Settings /// /// The target to rotate. /// [Serialized, Cleared] [field: Header("Target Settings"), DocumentedByXml] public GameObject Target { get; set; } /// /// The direction offset to use when considering the rotation origin. /// [Serialized, Cleared] [field: DocumentedByXml] public GameObject DirectionOffset { get; set; } #endregion #region Reference Settings /// /// The linked Internal Setup. /// [Serialized] [field: Header("Reference Settings"), DocumentedByXml, Restricted] public AxisRotatorConfigurator Configuration { get; protected set; } #endregion /// /// Called after has been changed. /// [CalledAfterChangeOf(nameof(LateralAxis))] protected virtual void OnAfterLateralAxisChange() { Configuration.SetAxisSources(); } /// /// Called after has been changed. /// [CalledAfterChangeOf(nameof(LongitudinalAxis))] protected virtual void OnAfterLongitudinalAxisChange() { Configuration.SetAxisSources(); } /// /// Called after has been changed. /// [CalledAfterChangeOf(nameof(Target))] protected virtual void OnAfterTargetChange() { Configuration.SetMutator(); } /// /// Called after has been changed. /// [CalledAfterChangeOf(nameof(DirectionOffset))] protected virtual void OnAfterDirectionOffsetChange() { Configuration.SetExtractor(); } } }