protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var job = new PlayerInputJob
        {
            MoveInput  = _moveInput,
            LookInput  = _lookInput,
            ShootInput = _shootInput
        };

        inputDeps = job.Schedule(this, inputDeps);
        barrier.AddJobHandleForProducer(inputDeps);
        return(inputDeps);
    }
Exemple #2
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var job = new PlayerInputJob
            {
                Ecb                = _barrier.CreateCommandBuffer().ToConcurrent(),
                MoveInput          = _moveInput,
                MouseInput         = _mouseInput,
                LookInput          = _lookInput,
                CustomInputs       = _customInputs,
                CustomSticksInputs = _customSticksInputs
            };

            inputDeps = job.Schedule(this, inputDeps);
            _barrier.AddJobHandleForProducer(inputDeps);
            return(inputDeps);
        }
Exemple #3
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var job = new PlayerInputJob
        {
            Left  = Input.GetKey(KeyCode.A),
            Right = Input.GetKey(KeyCode.D),
            Up    = Input.GetKey(KeyCode.W),
            //Down = Input.GetKeyDown(KeyCode.S),

            //UpLeft = Input.GetKeyDown(KeyCode.Q),
            //UpRight = Input.GetKeyDown(KeyCode.E),
            //DownLeft = Input.GetKeyDown(KeyCode.Z),
            //DownRight = Input.GetKeyDown(KeyCode.X),
        };

        return(job.Schedule(this, 1, inputDeps));
    }
Exemple #4
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var mousePos = Input.mousePosition;
        var ray      = Camera.main.ScreenPointToRay(mousePos);

        if (Physics.Raycast(ray, out RaycastHit hit))
        {
            mousePos = new float3(hit.point.x, 0, hit.point.z);
        }
        var job = new PlayerInputJob
        {
            RightClick    = Input.GetMouseButtonDown(1),
            LeftClick     = Input.GetMouseButtonDown(0),
            MousePosition = mousePos
        };

        return(job.Schedule(this, inputDeps));
    }
Exemple #5
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var job = new PlayerInputJob
        {
            Horizontal = Input.GetAxisRaw("Horizontal"),
            Vertical   = Input.GetAxisRaw("Vertical")


                         //Left = Input.GetKeyDown(KeyCode.A),
                         //Right = Input.GetKeyDown(KeyCode.D),
                         //Up = Input.GetKeyDown(KeyCode.W),
                         //Down = Input.GetKeyDown(KeyCode.S),

                         //UpLeft = Input.GetKeyDown(KeyCode.Q),
                         //UpRight = Input.GetKeyDown(KeyCode.E),
                         //DownLeft = Input.GetKeyDown(KeyCode.Z),
                         //DownRight = Input.GetKeyDown(KeyCode.X),
        };

        // This 1 here is the InnerLoop batch. Lower numbers mean bigger jobs.
        return(job.Schedule(this, 1, inputDeps));
    }
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var job = new PlayerInputJob
            {
                Left          = Input.GetKeyDown(KeyCode.A),
                Right         = Input.GetKeyDown(KeyCode.D),
                Up            = Input.GetKeyDown(KeyCode.W),
                Down          = Input.GetKeyDown(KeyCode.S),
                UpLeft        = Input.GetKeyDown(KeyCode.Q),
                UpRight       = Input.GetKeyDown(KeyCode.E),
                DownLeft      = Input.GetKeyDown(KeyCode.Z),
                DownRight     = Input.GetKeyDown(KeyCode.X),
                Fire          = Input.GetKeyDown(KeyCode.G),
                MousePosition =
                {
                    x = Input.mousePosition.x,
                    y = Input.mousePosition.y
                }
            };

            return(job.Schedule(this, inputDeps));
        }