void Start() { GameObject worldObjects = new GameObject("WorldObjects"); truckObjectHolder = new GameObject("TruckObjects"); truckObjectHolder.transform.SetParent(worldObjects.transform); cityObjectHolder = new GameObject("CityObjects"); cityObjectHolder.transform.SetParent(worldObjects.transform); //Each Holder will load prefabs individually for instantiation later if (TruckHolder == null) { TruckHolder = ScriptableObject.CreateInstance <TruckHolder>(); } if (CityHolder == null) { CityHolder = ScriptableObject.CreateInstance <CityHolder>(); } if (Settings == null) { Settings = FindObjectOfType <GameController>().Settings; } }
public async void AddAsyncName(City city) { await CityHolder.updateCityWithName(city); Cities.Add(city); }
public async void AddAsyncLatLon(City locazioneCorrente) { await CityHolder.updateCityWithLatLon(locazioneCorrente); Cities.Insert(0, locazioneCorrente); }