mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Update PropBuilder.cs
This commit is contained in:
parent
79b1e97eb2
commit
b87ff06a7c
@ -60,6 +60,22 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (var component in prop.GetComponentsInChildren<Component>())
|
foreach (var component in prop.GetComponentsInChildren<Component>())
|
||||||
|
{
|
||||||
|
// TODO: Make this work or smthng
|
||||||
|
if (component is GhostIK) (component as GhostIK).enabled = false;
|
||||||
|
if(component is GhostEffects) (component as GhostEffects).enabled = false;
|
||||||
|
|
||||||
|
|
||||||
|
var enabledField = component.GetType().GetField("enabled");
|
||||||
|
if(enabledField != null && enabledField.FieldType == typeof(bool)) enabledField.SetValue(component, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
prop.transform.parent = go.transform;
|
||||||
|
prop.transform.localPosition = position == null ? Vector3.zero : (Vector3)position;
|
||||||
|
|
||||||
|
Quaternion rot = rotation == null ? prefab.transform.rotation : Quaternion.Euler((Vector3)rotation);
|
||||||
|
prop.transform.rotation = rot;
|
||||||
|
if (alignWithNormal)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user