mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
parent
6210f2e594
commit
6a4e670a51
@ -70,10 +70,13 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
StreamingHandler.SetUpStreaming(prop, sector);
|
StreamingHandler.SetUpStreaming(prop, sector);
|
||||||
|
|
||||||
var isTorch = prop.GetComponent<VisionTorchItem>() != null;
|
var isTorch = prop.GetComponentInChildren<VisionTorchItem>() != null;
|
||||||
|
var isItem = false;
|
||||||
|
|
||||||
foreach (var component in prop.GetComponentsInChildren<Component>(true))
|
foreach (var component in prop.GetComponentsInChildren<Component>(true))
|
||||||
{
|
{
|
||||||
|
if (component.gameObject == prop && component is OWItem) isItem = true;
|
||||||
|
|
||||||
if (sector == null)
|
if (sector == null)
|
||||||
{
|
{
|
||||||
if (FixUnsectoredComponent(component)) continue;
|
if (FixUnsectoredComponent(component)) continue;
|
||||||
@ -83,6 +86,9 @@ namespace NewHorizons.Builder.Props
|
|||||||
FixComponent(component, go);
|
FixComponent(component, go);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Items shouldn't use these else they get weird
|
||||||
|
if (isItem) detail.keepLoaded = true;
|
||||||
|
|
||||||
prop.transform.position = detail.position == null ? go.transform.position : go.transform.TransformPoint(detail.position);
|
prop.transform.position = detail.position == null ? go.transform.position : go.transform.TransformPoint(detail.position);
|
||||||
|
|
||||||
Quaternion rot = detail.rotation == null ? Quaternion.identity : Quaternion.Euler(detail.rotation);
|
Quaternion rot = detail.rotation == null ? Quaternion.identity : Quaternion.Euler(detail.rotation);
|
||||||
@ -156,6 +162,13 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isItem)
|
||||||
|
{
|
||||||
|
// Else when you put them down you can't pick them back up
|
||||||
|
var col = prop.GetComponent<OWCollider>();
|
||||||
|
if (col != null) col._physicsRemoved = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!detail.keepLoaded) GroupsBuilder.Make(prop, sector);
|
if (!detail.keepLoaded) GroupsBuilder.Make(prop, sector);
|
||||||
prop.SetActive(true);
|
prop.SetActive(true);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user