Пример #1
0
    protected override void OnUpdate()
    {
        if (MonoInputManager.instance == null)
        {
            BurstDebug.LogWarning("Waiting for MonoInputManager");
            return;
        }

        MonoInputManager inputMan = MonoInputManager.instance;

        Entities.ForEach((ref InputStruct input) =>
        {
            input.moveRaw = inputMan.move;
            input.move    = inputMan.smoothedMove;

            input.mouseX = inputMan.mouse.x;
            input.mouseY = inputMan.mouse.y;
            input.alt    = inputMan.alt;

            //input.shift = Input.GetKey(KeyCode.LeftShift);
            input.jump = inputMan.jump;
        });
    }
Пример #2
0
    void Awake()
    {
        if (instance != null)
        {
            enabled = false;
            throw new UnityMiscExceptions.ExistingSingletonException("MonoInputManager");
        }

        controls = new PlayerControls();
        instance = this;

        controls.Player.Jump.performed += JumpBtnDown;
        controls.Player.Jump.canceled  += JumpBtnUp;

        controls.Player.Move.performed += Move;
        controls.Player.Move.canceled  += MoveClear;

        controls.Player.Look.performed += Mouse;
        controls.Player.Look.canceled  += MouseClear;

        controls.Player.Alt.performed += Alt;
        controls.Player.Alt.canceled  += AltClear;
    }