Beispiel #1
0
    public void SetColorByAction(Actions.ButtonActions action)
    {
        switch (action)
        {
        case Actions.ButtonActions.JUMP:
            currentColor = Color.white;
            break;

        case Actions.ButtonActions.DASH:
            currentColor = Color.red;
            break;

        case Actions.ButtonActions.FLAP:
            currentColor = Color.yellow;
            break;

        case Actions.ButtonActions.SHIELD:
            currentColor = Color.blue;
            break;

        default:
            Debug.Assert(false, "Attempting to set a non-existant action.");
            currentColor = Color.white;
            break;
        }
        GetRenderer().color = currentColor;
    }
Beispiel #2
0
 public void SetCurrentAction(Actions.ButtonActions action)
 {
     currentAction = action;
     playerView.SetColorByAction(currentAction);
 }