diff --git a/Editor/HumanoidControl/Targets/HandTarget_Editor.cs b/Editor/HumanoidControl/Targets/HandTarget_Editor.cs index 8a37d7c..045fdc9 100644 --- a/Editor/HumanoidControl/Targets/HandTarget_Editor.cs +++ b/Editor/HumanoidControl/Targets/HandTarget_Editor.cs @@ -145,8 +145,6 @@ namespace Passer.Humanoid { InteractionPointerButton(handTarget); serializedObject.ApplyModifiedProperties(); - //serializedObject.Update(); - //serializedObject.ApplyModifiedProperties(); } public static HandTarget Inspector(HandTarget handTarget, string name) { @@ -439,8 +437,8 @@ namespace Passer.Humanoid { if (showSettings) { EditorGUI.indentLevel++; - // Cannot use serializedPropery because showRealObjects is a getter/setter - bool showRealObjects = EditorGUILayout.Toggle("Show Real Objects", handTarget.showRealObjects); + SerializedProperty showObjectsProp = serializedObject.FindProperty("_showRealObjects"); + bool showRealObjects = EditorGUILayout.Toggle("Show Real Objects", showObjectsProp.boolValue); if (showRealObjects != handTarget.showRealObjects) { handTarget.showRealObjects = showRealObjects; handTarget.ShowSensors(showRealObjects, true); diff --git a/Runtime/HumanoidControl/Scripts/Targets/Target.cs b/Runtime/HumanoidControl/Scripts/Targets/Target.cs index fe2b0ca..752c9a4 100644 --- a/Runtime/HumanoidControl/Scripts/Targets/Target.cs +++ b/Runtime/HumanoidControl/Scripts/Targets/Target.cs @@ -17,6 +17,7 @@ namespace Passer { /// public abstract class Target : MonoBehaviour { + [SerializeField] protected bool _showRealObjects = true; /// /// show the target meshes