mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-22 08:08:51 -05:00
#179 - Fixes to AtomDrawer + FSM editor
This commit is contained in:
parent
cd8cd63ec0
commit
0540add7b8
@ -86,7 +86,13 @@ namespace UnityAtoms.Editor
|
||||
}
|
||||
else
|
||||
{
|
||||
property.objectReferenceValue = EditorGUI.ObjectField(position, property.objectReferenceValue, typeof(T), false);
|
||||
EditorGUI.BeginChangeCheck();
|
||||
var obj = EditorGUI.ObjectField(position, property.objectReferenceValue, typeof(T), false);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
property.objectReferenceValue = obj;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (property.objectReferenceValue == null)
|
||||
|
@ -17,7 +17,6 @@ namespace UnityAtoms.Editor
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
bool valueWasUpdated = false;
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("_developerDescription"));
|
||||
EditorGUILayout.Space();
|
||||
|
||||
@ -61,7 +60,7 @@ namespace UnityAtoms.Editor
|
||||
var value = serializedObject.FindProperty("_value").GetGenericPropertyValue(JsonUtility.FromJson<T>(JsonUtility.ToJson(atomTarget.BaseValue)));
|
||||
atomTarget.BaseValue = value;
|
||||
}
|
||||
valueWasUpdated = true;
|
||||
serializedObject.Update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,10 +113,7 @@ namespace UnityAtoms.Editor
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("_triggerChangedWithHistoryOnOnEnable"), new GUIContent("ChangedWithHistory"));
|
||||
}
|
||||
|
||||
if (!valueWasUpdated)
|
||||
{
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,8 +37,8 @@ namespace UnityAtoms.FSM.Editor
|
||||
const int raiseButtonWidth = 52;
|
||||
using (new EditorGUILayout.HorizontalScope())
|
||||
{
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("Changed"));
|
||||
var changed = serializedObject.FindProperty("Changed").objectReferenceValue;
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("_changed"));
|
||||
var changed = serializedObject.FindProperty("_changed").objectReferenceValue;
|
||||
if (changed != null && changed is AtomEventBase evt && target is AtomBaseVariable atomTarget)
|
||||
{
|
||||
GUILayout.Space(2);
|
||||
@ -52,8 +52,8 @@ namespace UnityAtoms.FSM.Editor
|
||||
|
||||
using (new EditorGUILayout.HorizontalScope())
|
||||
{
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("ChangedWithHistory"));
|
||||
var changedWithHistory = serializedObject.FindProperty("ChangedWithHistory").objectReferenceValue;
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("_changedWithHistory"));
|
||||
var changedWithHistory = serializedObject.FindProperty("_changedWithHistory").objectReferenceValue;
|
||||
if (changedWithHistory != null && changedWithHistory is AtomEventBase evt && target is AtomBaseVariable atomTarget)
|
||||
{
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user