mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
I don't know how I should structure this
This commit is contained in:
parent
e397cbc7c5
commit
48f501947c
@ -190,11 +190,6 @@ namespace NewHorizons.Builder.Body
|
||||
shockLayerRuleset._outerRadius = starModule.size * OuterRadiusRatio;
|
||||
if (starModule.tint != null) shockLayerRuleset._color *= starModule.tint.ToColor();
|
||||
|
||||
var stellarRemnant = MakeStellarRemnant(planetGO, sector, starModule);
|
||||
|
||||
controller.SetStellarRemnantController(stellarRemnant);
|
||||
|
||||
|
||||
return starController;
|
||||
}
|
||||
|
||||
@ -228,12 +223,6 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
planet.GetComponentInChildren<StarEvolutionController>(true).SetProxy(controller);
|
||||
|
||||
var stellarRemnant = MakeStellarRemnant(proxyGO, null, starModule);
|
||||
|
||||
planet.GetComponentInChildren<StellarRemnantController>(true).SetProxy(stellarRemnant);
|
||||
|
||||
controller.SetStellarRemnantController(stellarRemnant);
|
||||
|
||||
return proxyGO;
|
||||
}
|
||||
|
||||
@ -354,19 +343,5 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
return supernova;
|
||||
}
|
||||
|
||||
public static StellarRemnantController MakeStellarRemnant(GameObject rootObject, Sector sector, StarModule starModule)
|
||||
{
|
||||
var stellarRemnant = new GameObject("StellarRemnant");
|
||||
stellarRemnant.transform.SetParent(sector?.transform ?? rootObject.transform, false);
|
||||
stellarRemnant.SetActive(false);
|
||||
|
||||
var controller = stellarRemnant.AddComponent<StellarRemnantController>();
|
||||
controller.SetStarEvolutionController(rootObject.GetComponentInChildren<StarEvolutionController>());
|
||||
|
||||
stellarRemnant.SetActive(true);
|
||||
|
||||
return controller;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ using NewHorizons.Builder.Orbital;
|
||||
using NewHorizons.Builder.Props;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Components.Orbital;
|
||||
using NewHorizons.Components.SizeControllers;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
@ -203,6 +204,17 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
try
|
||||
{
|
||||
var rb = existingPlanet.GetComponent<OWRigidbody>();
|
||||
|
||||
var sector = SectorBuilder.Make(existingPlanet, rb, GetSphereOfInfluence(body));
|
||||
sector.name = $"StellarRemnant";
|
||||
|
||||
var stellarRemnantController = sector.gameObject.AddComponent<StellarRemnantController>();
|
||||
var starEvolutionController = existingPlanet.GetComponentInChildren<StarEvolutionController>(true);
|
||||
stellarRemnantController.SetStarEvolutionController(starEvolutionController);
|
||||
starEvolutionController.SetStellarRemnantController(stellarRemnantController);
|
||||
|
||||
SharedGenerateBody(body, existingPlanet, sector, rb);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user