Fix ShowRealObjectsSwitch persistency
This commit is contained in:
parent
e3ea1ce371
commit
927dfff7d1
@ -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);
|
||||
|
@ -17,6 +17,7 @@ namespace Passer {
|
||||
/// </summary>
|
||||
public abstract class Target : MonoBehaviour {
|
||||
|
||||
[SerializeField]
|
||||
protected bool _showRealObjects = true;
|
||||
/// <summary>
|
||||
/// show the target meshes
|
||||
|
Loading…
x
Reference in New Issue
Block a user