Update PropBuilder.cs

This commit is contained in:
Nick J. Connors 2022-01-03 02:27:26 -05:00
parent 79b1e97eb2
commit b87ff06a7c

View File

@ -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
{ {