/// <summary>
 /// Updates the current input mode if necessary
 /// </summary>
 /// <param name="mode">New Input Mode</param>
 public void UpdateInputMode(InputModeEnum mode)
 {
     if (this.CurrentInputMode != mode)
     {
         this.CurrentInputMode = mode;
     }
 }
 public KeyMapping(KeyList key, InputModeEnum mode, ActionEnum action, ActionEnum inverseAction = ActionEnum.None)
 {
     this.key           = key;
     this.mode          = mode;
     this.action        = action;
     this.inverseAction = inverseAction;
 }
Beispiel #3
0
    void OnInputModeChanged(InputModeEnum prevMode, InputModeEnum newMode)
    {
        Destroy(_zeldaInputMapping);
        Type type = null;

        switch (newMode)
        {
        case InputModeEnum.MouseAndKeyboard:
            type = typeof(ZeldaInputMapping_MouseKeyboard);
            //_zeldaInputMapping = gameObject.AddComponent<ZeldaInputMapping_MouseKeyboard>();
            break;

        case InputModeEnum.XBOX_Gamepad:
            type = typeof(ZeldaInputMapping_Xbox);
            //_zeldaInputMapping = gameObject.AddComponent<ZeldaInputMapping_Xbox>();
            break;

        case InputModeEnum.OculusTouch:
            type = typeof(ZeldaInputMapping_OculusTouch);
            //_zeldaInputMapping = gameObject.AddComponent<ZeldaInputMapping_OculusTouch>();
            break;

        default:
            break;
        }

        _zeldaInputMapping = gameObject.AddComponent(type) as ZeldaInputMapping_Base;
    }
Beispiel #4
0
    override protected void Awake()
    {
        base.Awake();

        // TODO

        //_inputMode = InputModeEnum.OculusTouch;
        //_zeldaInputMapping = gameObject.AddComponent<ZeldaInputMapping_OculusTouch>();

        //_inputMode = InputModeEnum.MouseAndKeyboard;
        //_zeldaInputMapping = gameObject.AddComponent<ZeldaInputMapping_MouseKeyboard>();

        _inputMode         = InputModeEnum.XBOX_Gamepad;
        _zeldaInputMapping = gameObject.AddComponent <ZeldaInputMapping_Xbox>();
    }
    /// <summary>
    /// Awake fires when object is instanciated
    /// </summary>
    private void Awake()
    {
        #region Persistance Pattern

        if (Instance == null)
        {
            Instance = this;
        }
        else if (Instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);

        #endregion Persistance Pattern

        this.CurrentInputMode = InputModeEnum.Keyboard;
    }
 public KeyMapping(int key, InputModeEnum mode, ActionEnum action)
 {
     this.key    = key;
     this.mode   = mode;
     this.action = action;
 }