Esempio n. 1
0
    // 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;
        }
    }
Esempio n. 2
0
 private void StateUpdated(StateManager.States newState)
 {
     if (newState == StateManager.States.SceneCreation)
     {
         m_session.Pause();
     }
 }
Esempio n. 3
0
 // 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;
 }
Esempio n. 4
0
 void Update()
 {
     // if state changed update visibility accordingly
     if (StateManager.Instance.currentState != internalState)
     {
         internalState = StateManager.Instance.currentState;
         SetVisibility(internalState != StateManager.States.HUD);
     }
 }
Esempio n. 5
0
 private void StateUpdated(StateManager.States newState)
 {
     gameObject.SetActive(isDisplayedByDefault == ((int)state > (int)newState));
 }
Esempio n. 6
0
 private void Start()
 {
     internalState = StateManager.Instance.currentState;
 }
Esempio n. 7
0
 public int TimesStateVisited(StateManager.States state)
 {
     return(visitedStates.FindAll(x => x == state).Count);
 }
Esempio n. 8
0
 private void UpdateText(StateManager.States newState)
 {
     text.text = newState.ToString();
 }