/****************************************************************************
* Copyright 2019 Nreal Techonology Limited. All rights reserved.
*
* This file is part of NRSDK.
*
* https://www.nreal.ai/
*
*****************************************************************************/
namespace NRKernal
{
/// A controller provider base.
public abstract class ControllerProviderBase
{
/// The states.
protected ControllerState[] states;
/// Gets or sets a value indicating whether the inited.
/// True if inited, false if not.
public bool Inited { get; protected set; }
/// Constructor.
/// The states.
public ControllerProviderBase(ControllerState[] states)
{
this.states = states;
}
/// Gets the number of controllers.
/// The number of controllers.
public abstract int ControllerCount { get; }
/// Executes the 'pause' action.
public abstract void OnPause();
/// Executes the 'resume' action.
public abstract void OnResume();
/// Updates this object.
public abstract void Update();
/// Executes the 'destroy' action.
public abstract void OnDestroy();
/// Trigger haptic vibration.
/// Zero-based index of the controller.
/// (Optional) The duration in seconds.
/// (Optional) The frequency.
/// (Optional) The amplitude.
public virtual void TriggerHapticVibration(int controllerIndex, float durationSeconds = 0.1f, float frequency = 200f, float amplitude = 0.8f) { }
/// Recenters this object.
public virtual void Recenter() { }
}
}