namespace VRTK.Prefabs.Locomotion.Movement.AxesToVector3
{
using System;
using UnityEngine;
using UnityEngine.Events;
using Malimbe.MemberChangeMethod;
using Malimbe.MemberClearanceMethod;
using Malimbe.PropertySerializationAttribute;
using Malimbe.XmlDocumentationAttribute;
using Zinnia.Action;
using Zinnia.Data.Attribute;
///
/// The public interface for the AxisSlide prefab.
///
public class AxesToVector3Facade : MonoBehaviour
{
///
/// Defines the event with the multiplied value.
///
[Serializable]
public class UnityEvent : UnityEvent
{
}
///
/// The way to use the given axis data.
///
public enum AxisUsage
{
///
/// The processed output is a continuous incremental value based on the axis input.
///
Incremental,
///
/// The processed output is a specific direction value only outputted once per axis change.
///
Directional
}
#region Axis Settings
///
/// The to utilize when applying the axis input.
///
[Serialized]
[field: Header("Axis Settings"), DocumentedByXml]
public AxisUsage AxisUsageType { get; set; }
///
/// The to get the lateral (left/right direction) data from.
///
[Serialized, Cleared]
[field: DocumentedByXml]
public FloatAction LateralAxis { get; set; }
///
/// The to get the longitudinal (forward/backward direction) data from.
///
[Serialized, Cleared]
[field: DocumentedByXml]
public FloatAction LongitudinalAxis { get; set; }
///
/// The multiplier to apply to the lateral axis.
///
[Serialized]
[field: DocumentedByXml]
public float LateralSpeedMultiplier { get; set; } = 1f;
///
/// The multiplier to apply to the longitudinal axis.
///
[Serialized]
[field: DocumentedByXml]
public float LongitudinalSpeedMultiplier { get; set; } = 1f;
#endregion
#region Direction Settings
///
/// The source of the forward direction to move towards.
///
[Serialized, Cleared]
[field: Header("Direction Settings"), DocumentedByXml]
public GameObject SourceOfForwardDirection { get; set; }
#endregion
#region Events
///
/// Emitted when the axes are converted into a .
///
[Header("Events"), DocumentedByXml]
public UnityEvent Processed = new UnityEvent();
#endregion
#region Reference Settings
///
/// The linked Internal Setup.
///
[Serialized]
[field: Header("Reference Settings"), DocumentedByXml, Restricted]
public AxesToVector3Processor Processor { get; protected set; }
#endregion
///
/// Called after has been changed.
///
[CalledAfterChangeOf(nameof(AxisUsageType))]
protected virtual void OnAfterAxisUsageTypeChange()
{
Processor.ConfigureAxisUsageType();
}
///
/// Called after has been changed.
///
[CalledAfterChangeOf(nameof(LateralAxis))]
protected virtual void OnAfterLateralAxisChange()
{
Processor.ConfigureAxisSources();
}
///
/// Called after has been changed.
///
[CalledAfterChangeOf(nameof(LongitudinalAxis))]
protected virtual void OnAfterLongitudinalAxisChange()
{
Processor.ConfigureAxisSources();
}
///
/// Called after has been changed.
///
[CalledAfterChangeOf(nameof(LateralSpeedMultiplier))]
protected virtual void OnAfterLateralSpeedMultiplierChange()
{
Processor.ConfigureMultipliers();
}
///
/// Called after has been changed.
///
[CalledAfterChangeOf(nameof(LongitudinalSpeedMultiplier))]
protected virtual void OnAfterLongitudinalSpeedMultiplierChange()
{
Processor.ConfigureMultipliers();
}
}
}