public void setup() { this.config = (CityGenConfig)Resources.Load("Config/CityGen"); // Load config this.cityContainer = GameObject.Find(config.CityParentObjectName); // Find city containment object. if (this.cityContainer == null) // Containment obj not found, make it. { Debug.Log(Logging.Error + "Couldn't find gameobject with name: " + config.CityParentObjectName + "! Making one!"); this.cityContainer = new GameObject(config.CityParentObjectName); this.citygen = this.cityContainer.AddComponent <CityGen>(); } }
private void Awake() { cityGen = GetComponent <CityGen>(); rimRadius = cityGen.RimRadius; laneWidth = cityGen.LaneWidth; maxRoadWidth = 4 * laneWidth; if (minSeparation < maxRoadWidth * 2) { minSeparation = maxRoadWidth * 2; } if (minStreets > maxStreets) { minStreets = maxStreets; } desiredStreetCount = Random.Range(minStreets, maxStreets + 1); for (int i = 0; i < diags.Count; i++) { diags[i] = diags[i].normalized; } maskRimSphere = Layers.GetMask(Layer.RimSphere); }
private void Awake() { cityGen = GetComponentInParent <CityGen>(); buildingsGen = GetComponentInParent <BuildingsGen>(); }
private void Awake() { cityGen = GetComponent <CityGen>(); }
private void Awake() { cityGen = GetComponent <CityGen>(); parkDistMin = cityGen.RimRadius * parkRadiusFractionMin; parkDistMax = cityGen.RimRadius * parkRadiusFractionMax; }