void Awake() { logSeriesId = LoggerAssembly.GetLogSeriesId(); globalParam = FindObjectOfType <FlashPedestriansGlobalParameters>(); pedInformer = FindObjectOfType <FlashPedestriansInformer>(); stationStats = FindObjectOfType <StationStatistics>(); spawners = FindObjectsOfType <FlashPedestriansSpawner>(); }
private async void AddStation(Station sta, TypeStation typeStation) { var stations = database.Collection("Stations"); if (typeStation.Equals(TypeStation.DEPARTURE)) { stations = database.Collection("StationsDeparture"); } else if (typeStation.Equals(TypeStation.ARRIVAL)) { stations = database.Collection("StationsArrival"); } if (sta != null) { try { var stationRef = stations.Document(sta.number.ToString()); await stationRef.UpdateAsync("occurence", FieldValue.Increment(1)); } catch (Exception) { var stationStatistics = new StationStatistics { type = typeStation, station = new Config.Station { address = sta.address, contractName = sta.contractName, name = sta.name, number = sta.number }, occurence = 1 }; await stations.Document(sta.number.ToString()).SetAsync(stationStatistics); } } }
// Use this for initialization void Awake() { stationStatistics = GameObject.Find("Stations").GetComponent <StationStatistics>(); }