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(); }
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); }
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); } }
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); }
public void Move() { _controller.Move(_heading); }
public void Update() { Vector2 direction = InputManager.Instance.GetCombinedMovementDirection(MOVEMENT_AXIS_NAME); m_MovementController.Move(direction * m_Speed); }
public void Move() { _controller.Move(_currentHeading); }
private void FixedUpdate() { _playerMovementController.Move(_movementInput); }