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