Fix ShowRealObjectsSwitch persistency
This commit is contained in:
parent
e3ea1ce371
commit
927dfff7d1
@ -145,8 +145,6 @@ namespace Passer.Humanoid {
|
|||||||
InteractionPointerButton(handTarget);
|
InteractionPointerButton(handTarget);
|
||||||
|
|
||||||
serializedObject.ApplyModifiedProperties();
|
serializedObject.ApplyModifiedProperties();
|
||||||
//serializedObject.Update();
|
|
||||||
//serializedObject.ApplyModifiedProperties();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HandTarget Inspector(HandTarget handTarget, string name) {
|
public static HandTarget Inspector(HandTarget handTarget, string name) {
|
||||||
@ -439,8 +437,8 @@ namespace Passer.Humanoid {
|
|||||||
if (showSettings) {
|
if (showSettings) {
|
||||||
EditorGUI.indentLevel++;
|
EditorGUI.indentLevel++;
|
||||||
|
|
||||||
// Cannot use serializedPropery because showRealObjects is a getter/setter
|
SerializedProperty showObjectsProp = serializedObject.FindProperty("_showRealObjects");
|
||||||
bool showRealObjects = EditorGUILayout.Toggle("Show Real Objects", handTarget.showRealObjects);
|
bool showRealObjects = EditorGUILayout.Toggle("Show Real Objects", showObjectsProp.boolValue);
|
||||||
if (showRealObjects != handTarget.showRealObjects) {
|
if (showRealObjects != handTarget.showRealObjects) {
|
||||||
handTarget.showRealObjects = showRealObjects;
|
handTarget.showRealObjects = showRealObjects;
|
||||||
handTarget.ShowSensors(showRealObjects, true);
|
handTarget.ShowSensors(showRealObjects, true);
|
||||||
|
@ -17,6 +17,7 @@ namespace Passer {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class Target : MonoBehaviour {
|
public abstract class Target : MonoBehaviour {
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
protected bool _showRealObjects = true;
|
protected bool _showRealObjects = true;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// show the target meshes
|
/// show the target meshes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user