Set sector's ID (#1018)

## Improvements

- ID on sector component is now set to the name of the body
This commit is contained in:
xen-42 2025-01-06 15:39:19 -05:00 committed by GitHub
commit ae09ab6a33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -26,6 +26,7 @@ namespace NewHorizons.Builder.Body
NHLogger.Log($"Creating stellar remnant for [{star.Config.name}]"); NHLogger.Log($"Creating stellar remnant for [{star.Config.name}]");
var sector = SectorBuilder.Make(go, rb, soi); var sector = SectorBuilder.Make(go, rb, soi);
sector._idString = star.Config.name;
sector.name = "StellarRemnant"; sector.name = "StellarRemnant";
sector.gameObject.SetActive(false); sector.gameObject.SetActive(false);

View File

@ -235,6 +235,7 @@ namespace NewHorizons.Handlers
var rb = existingPlanet.GetComponent<OWRigidbody>(); var rb = existingPlanet.GetComponent<OWRigidbody>();
var sector = SectorBuilder.Make(existingPlanet, rb, GetSphereOfInfluence(body)); var sector = SectorBuilder.Make(existingPlanet, rb, GetSphereOfInfluence(body));
sector._idString = body.Config.name;
sector.name = $"Sector-{existingPlanet.GetComponentsInChildren<Sector>().Count()}"; sector.name = $"Sector-{existingPlanet.GetComponentsInChildren<Sector>().Count()}";
SharedGenerateBody(body, existingPlanet, sector, rb); SharedGenerateBody(body, existingPlanet, sector, rb);
@ -394,6 +395,7 @@ namespace NewHorizons.Handlers
var ao = AstroObjectBuilder.Make(go, null, body, false); var ao = AstroObjectBuilder.Make(go, null, body, false);
var sector = SectorBuilder.Make(go, owRigidBody, sphereOfInfluence); var sector = SectorBuilder.Make(go, owRigidBody, sphereOfInfluence);
sector._idString = body.Config.name;
ao._rootSector = sector; ao._rootSector = sector;
ao._type = AstroObject.Type.None; ao._type = AstroObject.Type.None;
@ -470,6 +472,7 @@ namespace NewHorizons.Handlers
var ao = AstroObjectBuilder.Make(go, primaryBody, body, false); var ao = AstroObjectBuilder.Make(go, primaryBody, body, false);
var sector = SectorBuilder.Make(go, owRigidBody, sphereOfInfluence * 2f); var sector = SectorBuilder.Make(go, owRigidBody, sphereOfInfluence * 2f);
sector._idString = body.Config.name;
ao._rootSector = sector; ao._rootSector = sector;
if (body.Config.Base.surfaceGravity != 0) if (body.Config.Base.surfaceGravity != 0)
@ -595,6 +598,7 @@ namespace NewHorizons.Handlers
var remnant = Main.BodyDict[body.Config.starSystem].Where(x => x.Config.name == body.Config.name && x.Config.isStellarRemnant).FirstOrDefault(); var remnant = Main.BodyDict[body.Config.starSystem].Where(x => x.Config.name == body.Config.name && x.Config.isStellarRemnant).FirstOrDefault();
var remnantSector = SectorBuilder.Make(go, rb, sphereOfInfluence); var remnantSector = SectorBuilder.Make(go, rb, sphereOfInfluence);
remnantSector._idString = body.Config.name;
remnantSector.name = "CustomStellarRemnant"; remnantSector.name = "CustomStellarRemnant";
SharedGenerateBody(remnant, go, remnantSector, rb); SharedGenerateBody(remnant, go, remnantSector, rb);