undo that GeneralPropBuilder rename i made a while ago cuz its dumb

This commit is contained in:
JohnCorby 2023-09-03 15:30:23 -07:00
parent 110fa46712
commit d0ba74f4cd
3 changed files with 8 additions and 8 deletions

View File

@ -11,11 +11,11 @@ namespace NewHorizons.Builder.Props
{ {
public static GameObject MakeFromExisting(GameObject go, public static GameObject MakeFromExisting(GameObject go,
GameObject planetGO, Sector sector, GeneralPointPropInfo info, GameObject planetGO, Sector sector, GeneralPointPropInfo info,
MVector3 defaultPosition = null, string defaultParentPath = null, Transform parentOverride = null) MVector3 defaultPosition = null, string defaultParentPath = null, Transform defaultParent = null)
{ {
if (info == null) return go; if (info == null) return go;
go.transform.parent = parentOverride ?? sector?.transform ?? planetGO?.transform; go.transform.parent = defaultParent ?? sector?.transform ?? planetGO?.transform;
if (info is GeneralSolarSystemPropInfo solarSystemInfo && !string.IsNullOrEmpty(solarSystemInfo.parentBody)) if (info is GeneralSolarSystemPropInfo solarSystemInfo && !string.IsNullOrEmpty(solarSystemInfo.parentBody))
{ {
@ -87,20 +87,20 @@ namespace NewHorizons.Builder.Props
public static GameObject MakeNew(string defaultName, public static GameObject MakeNew(string defaultName,
GameObject planetGO, Sector sector, GeneralPointPropInfo info, GameObject planetGO, Sector sector, GeneralPointPropInfo info,
MVector3 defaultPosition = null, string defaultParentPath = null, Transform parentOverride = null) MVector3 defaultPosition = null, string defaultParentPath = null, Transform defaultParent = null)
{ {
var go = new GameObject(defaultName); var go = new GameObject(defaultName);
go.SetActive(false); go.SetActive(false);
return MakeFromExisting(go, planetGO, sector, info, defaultPosition, defaultParentPath, parentOverride); return MakeFromExisting(go, planetGO, sector, info, defaultPosition, defaultParentPath, defaultParent);
} }
public static GameObject MakeFromPrefab(GameObject prefab, string defaultName, public static GameObject MakeFromPrefab(GameObject prefab, string defaultName,
GameObject planetGO, Sector sector, GeneralPointPropInfo info, GameObject planetGO, Sector sector, GeneralPointPropInfo info,
MVector3 defaultPosition = null, string defaultParentPath = null, Transform parentOverride = null) MVector3 defaultPosition = null, string defaultParentPath = null, Transform defaultParent = null)
{ {
var go = prefab.InstantiateInactive(); var go = prefab.InstantiateInactive();
go.name = defaultName; go.name = defaultName;
return MakeFromExisting(go, planetGO, sector, info, defaultPosition, defaultParentPath, parentOverride); return MakeFromExisting(go, planetGO, sector, info, defaultPosition, defaultParentPath, defaultParent);
} }
} }
} }

View File

@ -46,7 +46,7 @@ namespace NewHorizons.Builder.Props
{ {
var socketInfo = quantumGroup.sockets[i]; var socketInfo = quantumGroup.sockets[i];
var socket = GeneralPropBuilder.MakeNew("Socket " + i, go, sector, socketInfo, parentOverride: groupRoot.transform); var socket = GeneralPropBuilder.MakeNew("Socket " + i, go, sector, socketInfo, defaultParent: groupRoot.transform);
sockets[i] = socket.AddComponent<QuantumSocket>(); sockets[i] = socket.AddComponent<QuantumSocket>();
sockets[i]._lightSources = new Light[0]; // TODO: make this customizable? sockets[i]._lightSources = new Light[0]; // TODO: make this customizable?

View File

@ -169,7 +169,7 @@ namespace NewHorizons.Handlers
var attachWarpExitToVessel = system.Config.Vessel?.warpExit?.attachToVessel ?? false; var attachWarpExitToVessel = system.Config.Vessel?.warpExit?.attachToVessel ?? false;
var warpExitParent = vesselWarpController._targetWarpPlatform.transform.parent; var warpExitParent = vesselWarpController._targetWarpPlatform.transform.parent;
var warpExit = GeneralPropBuilder.MakeFromExisting(vesselWarpController._targetWarpPlatform.gameObject, planetGO, null, system.Config.Vessel?.warpExit, parentOverride: attachWarpExitToVessel ? warpExitParent : null); var warpExit = GeneralPropBuilder.MakeFromExisting(vesselWarpController._targetWarpPlatform.gameObject, planetGO, null, system.Config.Vessel?.warpExit, defaultParent: attachWarpExitToVessel ? warpExitParent : null);
if (attachWarpExitToVessel) if (attachWarpExitToVessel)
{ {
warpExit.transform.parent = warpExitParent; warpExit.transform.parent = warpExitParent;