void NextStation() { NextStationID++; if (Stations[NextStationID] != null) { nextStation = Stations[NextStationID]; float dist = distBetweenStation(nextStation); DistFromStationInit = dist; DistFromStation = dist; StationText.SetText("Station " + (NextStationID + 1) + "/" + Stations.Count); animalSpawner.ActivateSpawn(transform.position, nextStation.transform.position); } //for sound, to reset the "halfway" whistle and 3/4 way bells whistleAlreadyPlayed = false; bellsAlreadyPlayed = false; }
float distBetweenStation(EndTrainStation station) { return(station.GetPos() - PerfectStopPos.transform.position.x); }