Exemplo n.º 1
0
		private IEnumerator doscan ()
		{
				GameObject ro = GameObject.Find (name_of_the_property_holder);
				if (ro == null) {
						ro = GameObject.Instantiate (allproperties, Vector3.zero, Quaternion.identity) as GameObject;
						ro.name = name_of_the_property_holder;
				}
				component_camera_tracker = GetComponent<FollowTrackingCamera> ();
				int endof = 50, station_c = 0;
				bigList.Clear ();
				for (int i=0; i<endof; i++) {
						string objectname = name_of_the_property_holder + "/" + getnum (i);
						//Debug.Log ("objectname to show:" + objectname);
						GameObject holder = GameObject.Find (objectname);
						if (holder != null) {
								//Debug.Log ("objectname found:" + objectname);
								Property pr = new Property ();
								pr.event_pass = Property.passing_event.NOTHING;
								pr.name = "P:" + holder.name;
								pr.id = i;
								pr.fix_price_inflation_factor = Random.Range (1.0f, 2.0f);
								pr.revenue_factor = Random.Range (0.9f, 1.5f);
								//setup and create the default location place;
								pr.setHolder (debug, holder, getGroundPosition (holder.transform.position), rezIsland);
								Station install_station = mstation.Find (x => x.position_step == station_c);
								if (install_station != null) {
										pr.event_pass = install_station.event_pass;
										pr.blocktype = install_station.blocktype;
										pr.name = "Special:" + install_station.name;
										pr.id = install_station.id;
										pr.owned_by_id = -2;
										pr.fix_price_inflation_factor = -1;
										pr.revenue_factor = -1;
										pr.setSpecialBuilding (install_station, Vector3.zero);
								}
								bigList.Add (pr);
								station_c++;
								yield return new WaitForEndOfFrame ();
						}
				}
		}
 private void Awake()
 {
     _Instance = this;
 }