// Update is called once per frame void Update() { if (currentState == StateManager.Instance.currentState) { return; } currentState = StateManager.Instance.currentState; switch (currentState) { case StateManager.States.HUD: arms.MaximumVelocity = armControlLimits.velocity; arms.MaximumAcceleration = armControlLimits.acceleration; leftHand.MaximumVelocity = handControlLimits.velocity; leftHand.MaximumAcceleration = handControlLimits.acceleration; rightHand.MaximumVelocity = handControlLimits.velocity; rightHand.MaximumAcceleration = handControlLimits.acceleration; break; default: arms.MaximumVelocity = armDefault.velocity; arms.MaximumAcceleration = armDefault.acceleration; leftHand.MaximumVelocity = handDefault.velocity; leftHand.MaximumAcceleration = handDefault.acceleration; rightHand.MaximumVelocity = handDefault.velocity; rightHand.MaximumAcceleration = handDefault.acceleration; break; } }
private void StateUpdated(StateManager.States newState) { if (newState == StateManager.States.SceneCreation) { m_session.Pause(); } }
// Start is called before the first frame update void Start() { armDefault = new VelAcc(arms.MaximumVelocity, arms.MaximumAcceleration); handDefault = new VelAcc(Mathf.Max(leftHand.MaximumVelocity, rightHand.MaximumVelocity), Mathf.Max(leftHand.MaximumAcceleration, rightHand.MaximumAcceleration)); currentState = StateManager.States.Training; }
void Update() { // if state changed update visibility accordingly if (StateManager.Instance.currentState != internalState) { internalState = StateManager.Instance.currentState; SetVisibility(internalState != StateManager.States.HUD); } }
private void StateUpdated(StateManager.States newState) { gameObject.SetActive(isDisplayedByDefault == ((int)state > (int)newState)); }
private void Start() { internalState = StateManager.Instance.currentState; }
public int TimesStateVisited(StateManager.States state) { return(visitedStates.FindAll(x => x == state).Count); }
private void UpdateText(StateManager.States newState) { text.text = newState.ToString(); }