示例#1
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;
		}
示例#2
0
		//
		public OrbitEntity (CelestialBody body, float mass, float diameter, OrbitEntity iparent, Vector3 barycenter)
		{
			parent = iparent;
			Init (body, mass, diameter, Barycenter);
		}
示例#3
0
		public void Destroy ()
		{
			VectorLine.Destroy (ref debugLine);
			Body = null;
			parent = null;
		}