public void SwitchInputLayout <T>() where T : InputBaseState { _currentInputLayout.Stop(); Destroy(_currentInputLayout); _currentInputLayout = this.gameObject.AddComponent <T>(); _currentInputLayout.Start(); }
private void Start() { _currentInputLayout = this.gameObject.AddComponent <KeyboardInput>(); DontDestroyOnLoad(this.gameObject); }