private void Init (CelestialBody body, float mass, float diameter, Vector3 barycenter) { Body = body; Mass = mass; EquatorialDiameter = diameter; Barycenter = barycenter; CalculateBaseProperties (); CalculateOrbitProperties (); debugLine = new VectorLine ("Debug_Orbit_" + Body.Name, new Vector3[90], null, 1.0f); }
public override void Destroy () { base.Destroy (); garrisonedShips.Clear (); stockpile.Destroy (); parent = null; foreach (ActorShip ship in garrisonedShips) { ship.homeColony = null; } }
public Colony (CelestialBody parentcb) { parent = parentcb; stockpile = new Stockpile (parent); population = 0; constructionYards = 500; shipYards = 0; garrisonedShips = new List<ActorShip> (); constructionJobs = new List<ConstructionJob> (); name = parent.Name + " Colony"; Interval = 60; }
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, Vector3 barycenter) { Init (body, mass, diameter, Barycenter); }
public void Destroy () { VectorLine.Destroy (ref debugLine); Body = null; parent = null; }