void Start() { globalWaypoints = new Vector3[localWaypoints.Length]; for (int i = 0; i < localWaypoints.Length; i++) { globalWaypoints[i] = localWaypoints[i] + transform.position; } passengerMover = GetComponent <PassengerMover>(); }
/// <summary> /// Move passenger by given displacement /// </summary> public void Move(Vector2 displacement, bool standingOnPlatform) { PassengerMover passengerMover = gameObject.GetComponent <PassengerMover>(); if (passengerMover) { passengerMover.CalculatePassengerMovement(displacement); passengerMover.MovePassengers(true); MoveTarget(displacement); passengerMover.MovePassengers(false); } else { MoveTarget(displacement); } }