示例#1
0
    public void Start()
    {
        GameObject t = new GameObject();

        GameObject.DontDestroyOnLoad(t);
        _Temp = t.transform;

#if !MADFINGER_KEYBOARD_MOUSE
        TouchControls = new PlayerControlsTouch(this);
#endif
        GamepadControls = new PlayerControlsGamepad(this);

#if UNITY_EDITOR || MADFINGER_KEYBOARD_MOUSE
        PCControls = new PlayerControlsPC(this);
#endif

#if UNITY_ANDROID && !UNITY_EDITOR
        MogaControls      = new PlayerControlsMoga(this);
        BlueToothControls = new PlayerControlsBlueTooth(this);
#endif

        if (PlayerControlsDrone.Enabled)
        {
            DroneControls = new PlayerControlsDrone(this);
        }

        Priority = (int)E_InputPriority.Game;
        Opacity  = E_InputOpacity.Opaque;
        InputManager.Register(this);
    }
示例#2
0
    public bool PressedOk()
    {
        if (         /*PlayerControlsGamepad.ButtonDown(PlayerControlsGamepad.E_Input.MenuOk) || */
            PlayerControlsGamepad.ButtonDown(PlayerControlsGamepad.E_Input.Fire) || Input.GetKeyDown("1") || Input.GetKeyDown("8"))
        {
            //Debug.Log(Time.realtimeSinceStartup + " joy: " + Input.GetKeyDown("joystick button 0") + " Fire: " + PlayerControlsGamepad.ButtonDown(PlayerControlsGamepad.E_Input.Fire) );
            return(true);
        }

        return(false);
    }