public Mode GetMode(EModeState state) { foreach (Mode mode in Modes) { if (mode.State == state) { return(mode); } } return(null); }
public void SetMode(EModeState state) { if (CurrentMode != null) { StartCoroutine(AnimateModeAlpha(CurrentMode, 0, AnimationOutTime, 0)); } if (state == EModeState.None) { return; } CurrentMode = GetMode(state); StartCoroutine(AnimateModeAlpha(CurrentMode, 1, AnimationInTime, AnimationOutTime)); }