コード例 #1
0
ファイル: PlayerScript.cs プロジェクト: ctzastas/Party_Game
    //Check for anything that requires Physics
    private void FixedUpdate()
    {
        if (playerInteractions != null)
        {
            playerInteractions.sensor.Sensor(_HoldingPosition);
        }

        if (playerNum < player.GetPlayers().Count&& playerMovement != null)
        {
            playerMovement.Move(rb, playerNum, player);
            playerMovement.Move(PlayerObject.gameObject, playerNum, player);
        }
    }
コード例 #2
0
 private void Update()
 {
     movement.Move(physicStats.speed, Vector2.right);
     if (goUp)
     {
         movement.Jump(physicStats.height);
     }
 }
コード例 #3
0
 public void Move()
 {
     if (!_isMoving)
     {
         if (Input.GetMouseButtonDown(0))
         {
             var mousePos       = _mouse.GetMousePos(this);
             var validPositions = _gameMap.GetValidMovePositions(this);
             if (validPositions.Contains(mousePos))
             {
                 var currentDir = _playerMovement.GetDirection(this);
                 _spriteRenderer.RenderDirection(this, currentDir);
                 StartCoroutine(_playerMovement.Move(this));
                 UseMoveTurn();
             }
         }
     }
 }
コード例 #4
0
ファイル: BasePlayer.cs プロジェクト: glochtefeld/circle-jam
        private void FixedUpdate()
        {
            if (_levelOver)
            {
                return;
            }
            movement.Move(input.ReadInput());
            if (input.Mouse() && !_hookWasShot)
            {
                ShootHook();
            }
            else if (!input.Mouse() && _hooked)
            {
                _hooked      = false;
                _hookWasShot = false;
                hookController.GetComponent <SetHook>()
                .UnHook();

                StartWalking();
            }
        }
コード例 #5
0
        public override void SimulateOwner()
        {
            if (AcceptMove == true)
            {
                UpdateMoveInputs();
            }

            if (AcceptLook)
            {
                UpdateLookInput();
            }

            Vector3 direction = Vector3.zero;

            if (_forward)
            {
                direction += transform.forward;
            }
            else if (_back)
            {
                direction += -1 * transform.forward;
            }

            if (_left)
            {
                direction += -1 * transform.right;
            }
            else if (_right)
            {
                direction += transform.right;
            }

            _playerMovement.Rotate(_yaw);
            _playerMovement.Move(direction);

            UpdatePitch();

            UpdateAnimator();
        }