Пример #1
0
		public static List<PlanetarySystem> AddPlanetarySystem (int qty=1, Coord coord=null)
		{
			List<PlanetarySystem> systems = new List<PlanetarySystem> ();
			for (int i =0; i<qty; i++) {
				PlanetarySystem sys;
				sys = new PlanetarySystem (coord);
				sys.ID = i;
				systems.Add (sys);
			}
			return systems;
		}
Пример #2
0
		public virtual Entity Init (string defID, CelestialBodyType Type, float Mass, float Diameter, PlanetarySystem System, CelestialBody parent=null)
		{

			type = Type;
			if (parent == null) {
				orbit = new OrbitEntity (this, Mass, Diameter, Vector3.zero);
			} else {
				orbit = new OrbitEntity (this, Mass, Diameter, parent.orbit, parent.orbit.Barycenter);
			}
			Entity entity = base.Init (defID);
			ChangeSystem (System);
			ResourceManager.RandomizeStockpile (this);
			Name = system.name + " " + type.ToString () + " " + UnityEngine.Random.Range (0, 999);
			//colony = new Colony (this);

			return entity;
		}
Пример #3
0
		public void ChangeSystem (int id)
		{
			if (id < 0) {
				id = 0;
			}
			if (id > planetarySystems.Count - 1) {
				id = planetarySystems.Count - 1;
			}
			currentSystem.SetVisiblity (false);
			currentSystem = planetarySystems [id];
			currentSystemID = id;
			currentSystem.SetVisiblity (true);
		}