Example #1
0
    public override void SimulateController()
    {
        PollKeys(false);

        IPlayerCommandInput input = PlayerCommand.Create();

        input.Forward  = _forward;
        input.Backward = _backward;
        input.Left     = _left;
        input.Right    = _right;
        input.Jump     = _jump;

        entity.QueueInput(input);
    }
    public override void SimulateController()
    {
        IPlayerCommandInput input = PlayerCommand.Create();

        input.Forward  = _forward;
        input.Backward = _backward;
        input.Right    = _right;
        input.Left     = _left;
        input.Yaw      = _yaw;
        input.Pitch    = _pitch;

        entity.QueueInput(input);

        _playerMotor.ExecuteCommand(_forward, _backward, _left, _right, _yaw, _pitch);
    }
Example #3
0
        public override void SimulateController()
        {
            PollKeys(false);

            IPlayerCommandInput input = PlayerCommand.Create();

            input.forward  = _forward;
            input.backward = _backward;
            input.left     = _left;
            input.right    = _right;
            input.jump     = _jump;
            input.yaw      = _yaw;
            input.pitch    = _pitch;

            entity.QueueInput(input);
        }
        public override void SimulateController()
        {
            GetInputs(true);

            IPlayerCommandInput cmd = PlayerCommand.Create();

            cmd.forward  = input.forward;
            cmd.backward = input.backwards;
            cmd.right    = input.right;
            cmd.left     = input.left;

            cmd.jump = input.jump;

            cmd.yaw   = input.yaw;
            cmd.pitch = input.pitch;

            entity.QueueInput(cmd);
        }
Example #5
0
    // Only called on the PC that owns this Entity.
    // We do NOT want to read mouse data; this would double our mouse movement.
    public override void SimulateController()
    {
        PollKeys(false);

        IPlayerCommandInput input = PlayerCommand.Create();

        // Copies all the local variables to the input command.
        input.Forward     = _forward;
        input.Backward    = _backward;
        input.LeftStrafe  = _leftStrafe;
        input.RightStrafe = _rightStrafe;
        input.Jump        = _jump;
        input.Yaw         = _yaw;
        input.Pitch       = _pitch;

        // Queues the input for processing; client prediction.
        entity.QueueInput(input);
    }
Example #6
0
    public override void SimulateController()
    {
        IPlayerCommandInput input = PlayerCommand.Create();

        input.Forward  = _forward;
        input.Backward = _backward;
        input.Right    = _right;
        input.Left     = _left;
        input.Yaw      = _yaw;
        input.Pitch    = _pitch;
        input.Jump     = _jump;

        input.Fire   = _fire;
        input.Scope  = _aiming;
        input.Reload = _reload;

        entity.QueueInput(input);

        _playerMotor.ExecuteCommand(_forward, _backward, _left, _right, _jump, _yaw, _pitch);
        _playerWeapons.ExecuteCommand(_fire, _aiming, _reload, BoltNetwork.ServerFrame % 1024);
    }
        public override void SimulateController()
        {
            PollKeys(false);

            IPlayerCommandInput input = PlayerCommand.Create();

            input.forward  = forward;
            input.backward = backward;
            input.left     = left;
            input.right    = right;
            input.jump     = jump;

            input.aiming = aiming;
            input.fire   = fire;

            input.yaw   = yaw;
            input.pitch = pitch;

            input.weapon = weapon;
            input.Token  = new TestToken();

            entity.QueueInput(input);
        }
    public override void SimulateController()
    {
        IPlayerCommandInput input = PlayerCommand.Create();

        input.forward = Input.GetKey(KeyCode.W);
        input.back    = Input.GetKey(KeyCode.S);
        input.left    = Input.GetKey(KeyCode.A);
        input.right   = Input.GetKey(KeyCode.D);


        Vector3 position = Input.mousePosition;
        Ray     ray      = Camera.main.ScreenPointToRay(position);

        RaycastHit[] hits = Physics.RaycastAll(ray, 1000, validLayers);


        if (Input.GetMouseButtonDown(0))
        {
            foreach (RaycastHit hit in hits)
            {
                //Debug.Log(hit);
                if (!hit.collider.isTrigger)
                {
                    //input.shootDirection = (transform.position - hit.point).normalized;
                    Vector3 t = (hit.point - transform.position);
                    t.y = 0;
                    input.shootDirection = t;

                    break;
                }
            }
        }


        entity.QueueInput(input);
    }