public override void Setup() { venus = new AstroObject(0, "venus", 60.51, new Point3d(), 1082.0, 224.4); earth = new AstroObject(1, "earth", 63.71, new Point3d(), 1496.0, 365.4); moon = new AstroObject(2, "moon", 17.37, earth.Center(), 384.0, 27.32); mars = new AstroObject(3, "mars", 33.97, new Point3d(), 2279.3, 686.5); jupiter = new AstroObject(4, "jupiter", 699.11, new Point3d(), 7785.0, 4329.5); saturn = new AstroObject(5, "saturn", 602.68, new Point3d(), 14267.2, 10752.9); }
void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (scene.name != "SolarSystem") { return; } foreach (var body in BodyList) { var planetObject = GenerateBody(body.Config); var primayBody = Locator.GetAstroObject(AstroObject.StringIDToAstroObjectName(body.Config.PrimaryBody)); planetObject.transform.parent = Locator.GetRootTransform(); planetObject.transform.position = primayBody.gameObject.transform.position + body.Config.Position.ToVector3(); planetObject.SetActive(true); body.Object = planetObject; } finishNextUpdate = true; }
public static void Make(GameObject body, AstroObject astroobject) { GameObject orbit = new GameObject(); orbit.transform.parent = body.transform; var LR = orbit.AddComponent <LineRenderer>(); //LR.material = GameObject.Find("OrbitLine_TH").GetComponent<LineRenderer>().material; LR.useWorldSpace = false; LR.loop = false; Logger.Log("AO primary body is " + astroobject.GetPrimaryBody().name, Logger.LogType.Log); var ol = orbit.AddComponent <OrbitLine>(); ol.SetValue("_astroObject", astroobject); ol.SetValue("_fade", false); ol.SetValue("_lineWidth", 5); Logger.Log("Finished building orbit line", Logger.LogType.Log); }
public SystemEdge(AstroObject target, float distance) : base(target) { this.distance = distance; }
public AstroEdge(AstroObject target) { this.target = target; }