public Color GetColorForState(LevelButtonState state) { switch (state) { case LevelButtonState.Locked: return(locked); case LevelButtonState.Hidden: return(hidden); case LevelButtonState.Unlocked: return(unlocked); default: throw new ArgumentOutOfRangeException("state"); } }
private void SetInteractable(LevelButtonState state) { switch (state) { case LevelButtonState.Locked: button.interactable = false; break; case LevelButtonState.Hidden: case LevelButtonState.Unlocked: button.interactable = true; break; } }
public void SetButtonState(LevelButtonState state) { levelThumb.color = levelThumbColors.GetColorForState(state); lockIcon.color = lockIconColors.GetColorForState(state); SetInteractable(state); }