private void DisableAll() { foreach (ICharacterController characterController in _controllers) { characterController.enabled = false; } _currentType = CharacterControllerType.End; }
public void SetCurrentControllerType(CharacterControllerType type) { if (_currentState != null) { if (_currentType == type) { return; } _currentState.enabled = false; } _currentState = _controllers[(int)type]; _currentState.Init(); _currentState.enabled = true; _currentType = type; }