void ShowState(PlayerBaseState state)
 {
     if (state.GetType() == typeof(PlayerIdleState))
     {
         setButtonDown(IdleImage);
         setButtonUp(JumpingImage);
         setButtonUp(DuckingImage);
         setButtonUp(SpinningImage);
     }
     else if (state.GetType() == typeof(PlayerJumpingState))
     {
         setButtonUp(IdleImage);
         setButtonDown(JumpingImage);
         setButtonUp(DuckingImage);
         setButtonUp(SpinningImage);
     }
     else if (state.GetType() == typeof(PlayerDuckingState))
     {
         setButtonUp(IdleImage);
         setButtonUp(JumpingImage);
         setButtonDown(DuckingImage);
         setButtonUp(SpinningImage);
     }
     else if (state.GetType() == typeof(PlayerSpinningState))
     {
         setButtonUp(IdleImage);
         setButtonUp(JumpingImage);
         setButtonUp(DuckingImage);
         setButtonDown(SpinningImage);
     }
 }
Beispiel #2
0
 private void IfDebugPrintStates()
 {
     if (printDebugStates)
     {
         debugState = currentState.GetType().Name;
         Debug.Log(debugState);
     }
 }
    public bool CheckIfCanTransitionToState(PlayerBaseState state)
    {
        bool result = false;

        if (_unlockableTracker.IsCharacterUnlocked(state.GetType()))
        {
            result = true;
        }

        return(result);
    }
Beispiel #4
0
 public string GetStateName()
 {
     return(currentState.GetType().Name);
 }
Beispiel #5
0
 //Representing the state of player avatar aka white angel
 public void playerShowState(PlayerBaseState state)
 {
     //Check if current state is idle state
     if (state.GetType() == typeof(PlayerIdleState))
     {
         setButtonDown(idleStateButton);    //Is currently idle
         setButtonUp(walkingStateButton);   //Not currently walking
         setButtonUp(readingStateButton);   //Not currently reading
         setButtonUp(drinkingStateButton);  //Not currently eating
         setButtonUp(miracleStateButton);   //Not currently casting miracle
         setButtonUp(surprisedStateButton); //Not currently surprised
         //Debug.Log("Idle button on");
     }
     else if (state.GetType() == typeof(PlayerWalkingState))
     {
         setButtonUp(idleStateButton);      //Not currently idle
         setButtonDown(walkingStateButton); //Is currently walking
         setButtonUp(readingStateButton);   //Not currently reading
         setButtonUp(drinkingStateButton);  //Not currently eating
         setButtonUp(miracleStateButton);   //Not currently casting miracle
         setButtonUp(surprisedStateButton); //Not currently surprised
         //Debug.Log("Walking button on");
     }
     else if (state.GetType() == typeof(PlayerReadingState))
     {
         setButtonUp(idleStateButton);      //Not currently idle
         setButtonUp(walkingStateButton);   //Not currently walking
         setButtonDown(readingStateButton); //Is currently reading
         setButtonUp(drinkingStateButton);  //Not currently eating
         setButtonUp(miracleStateButton);   //Not currently casting miracle
         setButtonUp(surprisedStateButton); //Not currently surprised
         //Debug.Log("Reading button on");
     }
     else if (state.GetType() == typeof(PlayerDrinkingState))
     {
         setButtonUp(idleStateButton);       //Not currently idle
         setButtonUp(walkingStateButton);    //Not currently walking
         setButtonUp(readingStateButton);    //Not currently reading
         setButtonDown(drinkingStateButton); //Is currently eating
         setButtonUp(miracleStateButton);    //Not currently casting miracle
         setButtonUp(surprisedStateButton);  //Not currently surprised
         //Debug.Log("Eating button on");
     }
     else if (state.GetType() == typeof(PlayerMiracleState))
     {
         setButtonUp(idleStateButton);      //Not currently idle
         setButtonUp(walkingStateButton);   //Not currently walking
         setButtonUp(readingStateButton);   //Not currently reading
         setButtonUp(drinkingStateButton);  //Not currently eating
         setButtonDown(miracleStateButton); //Is currently casting miracle
         setButtonUp(surprisedStateButton); //Not currently surprised
         //Debug.Log("Miracle button on");
     }
     else if (state.GetType() == typeof(PlayerSurprisedState))
     {
         setButtonUp(idleStateButton);        //Not currently idle
         setButtonUp(walkingStateButton);     //Not currently walking
         setButtonUp(readingStateButton);     //Not currently reading
         setButtonUp(drinkingStateButton);    //Not currently eating
         setButtonUp(miracleStateButton);     //Not currently casting miracle
         setButtonDown(surprisedStateButton); //Is currently surprised
         //Debug.Log("Surprised button on");
     }
     else if (state.GetType() == typeof(PlayerWorriedState))
     {
         setButtonUp(idleStateButton);        //Not currently idle
         setButtonUp(walkingStateButton);     //Not currently walking
         setButtonUp(readingStateButton);     //Not currently reading
         setButtonUp(drinkingStateButton);    //Not currently eating
         setButtonUp(miracleStateButton);     //Not currently casting miracle
         setButtonDown(surprisedStateButton); //Is currently surprised
         //Debug.Log("Surprised button on");
     }
 }