コード例 #1
0
ファイル: PlayerView.cs プロジェクト: Loveschach/OneButton
    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;
    }
コード例 #2
0
 public void SetCurrentAction(Actions.ButtonActions action)
 {
     currentAction = action;
     playerView.SetColorByAction(currentAction);
 }