namespace VRTK.Prefabs.CameraRig.SimulatedCameraRig
{
using UnityEngine;
using Malimbe.MemberChangeMethod;
using Malimbe.XmlDocumentationAttribute;
using Malimbe.PropertySerializationAttribute;
using Zinnia.Data.Attribute;
///
/// The public interface into the SimulatedCameraRig Prefab.
///
public class SimulatorFacade : MonoBehaviour
{
#region Simulator Settings
///
/// The speed at which to move the player around via the default movement keys.
///
[Serialized]
[field: Header("Simulator Settings"), DocumentedByXml]
public float PlayerSpeed { get; set; } = 0.05f;
///
/// The speed at which to move the controllers around via the default movement keys.
///
[Serialized]
[field: DocumentedByXml]
public float ControllerSpeed { get; set; } = 0.025f;
#endregion
#region System Settings
///
/// Determines whether to disable .
///
[Serialized]
[field: Header("System Settings"), DocumentedByXml]
public bool DisableXRSettings { get; set; } = true;
///
/// The frame rate to simulate with fixedDeltaTime.
///
[Serialized]
[field: DocumentedByXml]
public float SimulatedFrameRate { get; set; } = 90f;
#endregion
#region Reference Settings
///
/// The linked Internal Setup.
///
[Serialized]
[field: Header("Reference Settings"), DocumentedByXml, Restricted]
public SimulatorConfigurator Configuration { get; protected set; }
#endregion
///
/// Called after has been changed.
///
[CalledAfterChangeOf(nameof(PlayerSpeed))]
protected virtual void OnAfterPlayerSpeedChange()
{
Configuration.ConfigureControlSpeed();
}
///
/// Called after has been changed.
///
[CalledAfterChangeOf(nameof(ControllerSpeed))]
protected virtual void OnAfterControllerSpeedChange()
{
Configuration.ConfigureControlSpeed();
}
///
/// Called after has been changed.
///
[CalledAfterChangeOf(nameof(DisableXRSettings))]
protected virtual void OnAfterDisableXRSettingsChange()
{
Configuration.ConfigureXRSettings(DisableXRSettings);
}
///
/// Called after has been changed.
///
[CalledAfterChangeOf(nameof(SimulatedFrameRate))]
protected virtual void OnAfterSimulatedFrameRateChange()
{
Configuration.ConfigureSimulatedFrameRate();
}
}
}