예제 #1
0
        public void Move(Movement movement)
        {
            Position newPosition = movementController.Move(this.ActualPosition, movement, 1);

            Map.MovePlayer(this.ActualPosition, newPosition);
            Notify("You moved to " + this.ActualPosition);
            NotifyServer(this.ToString() + " moved to " + this.ActualPosition);
            SpotNearbyPlayers();
        }
예제 #2
0
        public IEnumerator GoTo(Vector3 target)
        {
            int  horizontal    = target.x < transform.position.x ? -1 : 1;
            bool targetReached = false;

            while (!targetReached)
            {
                MovementController.Move(horizontal);
                if (horizontal == 1)
                {
                    targetReached = transform.position.x > target.x;
                }
                else
                {
                    targetReached = transform.position.x < target.x;
                }
                yield return(null);
            }

            MovementController.Move(0);
        }
예제 #3
0
        public override void Execute()
        {
            if (moveable != null && !KeyboardPauseCommand.isPaused)
            {
                float velocityY = moveable.Velocity.y + Time.deltaTime * -EnvironmentSettings.Gravity;

                moveable.Velocity = (transform.right * MoveDirection.x * moveable.MoveSpeed.x) +
                                    (transform.forward * MoveDirection.z * moveable.MoveSpeed.z);

                moveable.Velocity = new Vector3(moveable.Velocity.x, velocityY, moveable.Velocity.z);

                moveController.Move(moveable.Velocity);
            }
        }
예제 #4
0
        private void Update_Moving()
        {
            var targetPoint  = m_WayPoints[m_TargetIdx].position.ToVec2();
            var currentPoint = transform.position.ToVec2();

            var dir         = targetPoint - currentPoint;
            var distanceSqr = dir.sqrMagnitude;

            if (distanceSqr > 0.1f)
            {
                m_MovementController.Move(dir.normalized * m_Speed);
            }
            else
            {
                m_TargetIdx++;
                if (m_RandomizeTargetWaypoints)
                {
                    m_TargetIdx = UnityEngine.Random.Range(0, m_WayPoints.Length);
                }
                if (m_TargetIdx >= m_WayPoints.Length)
                {
                    m_TargetIdx        = 0;
                    m_LookDelayTimeout = 0.0f;
                }

                if (UnityEngine.Random.Range(0, 2) == 1)
                {
                    m_LookDirIdx   = 0;
                    m_CurrentState = State.Looking;
                }
                else
                {
                    m_CurrentState = State.Moving;
                }
            }
        }
 public void Move()
 {
     movementController.Move(gravity);
 }
예제 #6
0
파일: Golem.cs 프로젝트: ConnorY97/EndGame
 public void Move()
 {
     _controller.Move(_heading);
 }
예제 #7
0
        public void Update()
        {
            Vector2 direction = InputManager.Instance.GetCombinedMovementDirection(MOVEMENT_AXIS_NAME);

            m_MovementController.Move(direction * m_Speed);
        }
예제 #8
0
 public void Move()
 {
     _controller.Move(_currentHeading);
 }
예제 #9
0
 private void FixedUpdate()
 {
     _playerMovementController.Move(_movementInput);
 }