mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
use planet sector if no primary body
This commit is contained in:
parent
53ea4a055d
commit
7ebfd1ebf6
@ -34,7 +34,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
if (_lavaMaterial == null) _lavaMaterial = new Material(SearchUtilities.Find("VolcanicMoon_Body/MoltenCore_VM/LavaSphere").GetComponent<MeshRenderer>().sharedMaterial).DontDestroyOnLoad();
|
if (_lavaMaterial == null) _lavaMaterial = new Material(SearchUtilities.Find("VolcanicMoon_Body/MoltenCore_VM/LavaSphere").GetComponent<MeshRenderer>().sharedMaterial).DontDestroyOnLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Make(GameObject planetGO, ConstantForceDetector detector, OWRigidbody rigidbody, FunnelModule module)
|
public static void Make(GameObject planetGO, Sector sector, ConstantForceDetector detector, OWRigidbody rigidbody, FunnelModule module)
|
||||||
{
|
{
|
||||||
InitPrefabs();
|
InitPrefabs();
|
||||||
|
|
||||||
@ -165,7 +165,9 @@ namespace NewHorizons.Builder.Body
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var sector = planetGO.GetComponent<AstroObject>().GetPrimaryBody().GetRootSector();
|
var primaryBody = planetGO.GetComponent<AstroObject>().GetPrimaryBody();
|
||||||
|
if (primaryBody != null) sector = primaryBody.GetRootSector();
|
||||||
|
|
||||||
proxyGO.GetComponent<SectorProxy>().SetSector(sector);
|
proxyGO.GetComponent<SectorProxy>().SetSector(sector);
|
||||||
geoGO.GetComponent<SectorCullGroup>().SetSector(sector);
|
geoGO.GetComponent<SectorCullGroup>().SetSector(sector);
|
||||||
volumesGO.GetComponent<SectorCollisionGroup>().SetSector(sector);
|
volumesGO.GetComponent<SectorCollisionGroup>().SetSector(sector);
|
||||||
|
|||||||
@ -638,7 +638,7 @@ namespace NewHorizons.Handlers
|
|||||||
|
|
||||||
if (body.Config.Funnel != null)
|
if (body.Config.Funnel != null)
|
||||||
{
|
{
|
||||||
FunnelBuilder.Make(go, go.GetComponentInChildren<ConstantForceDetector>(), rb, body.Config.Funnel);
|
FunnelBuilder.Make(go, sector, go.GetComponentInChildren<ConstantForceDetector>(), rb, body.Config.Funnel);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Has to go last probably
|
// Has to go last probably
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user