Пример #1
0
    void Update()
    {
        if (GameManager.Instance.GetRoundTime <= 150f && spawnedIn == false && setCourse == false)        // Warp close to station 2.5 mins before round ends
        {
            SpawnNearStation();
            setCourse = true;
        }

        if (spawnedIn && setCourse && Vector2.Distance(transform.position, destination) < 2)        //If shuttle arrived
        {
            arrivedAtStation = true;
            GameManager.Instance.shuttleArrived = true;
            setCourse = false;

            mm.SetPosition(destination);

            mm.StopMovement();
            mm.RotateTo(Orientation.Right);             //Rotate shuttle correctly so doors are facing correctly
            mm.ChangeDir(Orientation.Left);             //Reverse into station evac doors.
            StartCoroutine(ReverseIntoStation(mm));
        }

        if (GameManager.Instance.GetRoundTime <= 30f && arrivedAtStation == true)         // Depart the shuttle
        {
            mm.ChangeDir(Orientation.Right);
            mm.StartMovement();
        }
    }
Пример #2
0
    void Update()
    {
        if (spawnedIn && setCourse && Vector2.Distance(transform.position, destination) < 2)         //If shuttle arrived
        {
            arrivedAtStation = true;
            GameManager.Instance.shuttleArrived = true;
            setCourse = false;

            mm.SetPosition(destination);

            mm.StopMovement();
            mm.RotateTo(Orientation.Right);             //Rotate shuttle correctly so doors are facing correctly
            mm.ChangeDir(Orientation.Left);             //Reverse into station evac doors.
            StartCoroutine(ReverseIntoStation(mm));
        }

        if (arrivedAtStation && !departed)
        {
            waitAtStationTime += Time.deltaTime;
            if (waitAtStationTime > 60f)
            {
                DepartStation();
            }
        }

        if (departed && !roundEnded)
        {
            departingFlightTime += Time.deltaTime;
            if (departingFlightTime > 60f)
            {
                roundEnded = true;
                GameManager.Instance.RoundEnd();
            }
        }
    }
Пример #3
0
 /// <summary>
 /// Send Shuttle to the station.
 /// Server only.
 /// </summary>
 public void MoveToStation()
 {
     mm.ChangeDir(Orientation.Down);
     MoveTo(StationDest);
 }