Пример #1
0
    void Start()
    {
        globalWaypoints = new Vector3[localWaypoints.Length];
        for (int i = 0; i < localWaypoints.Length; i++)
        {
            globalWaypoints[i] = localWaypoints[i] + transform.position;
        }

        passengerMover = GetComponent <PassengerMover>();
    }
Пример #2
0
    /// <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);
        }
    }