mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2025-09-18 01:54:35 +08:00
improving stability of template overriders in prefabs
This commit is contained in:
parent
990f3adda6
commit
0823707ac8
@ -71,10 +71,9 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
int index = componentsProp.arraySize;
|
||||||
componentsProp.InsertArrayElementAtIndex(0);
|
componentsProp.InsertArrayElementAtIndex(index);
|
||||||
|
componentsProp.GetArrayElementAtIndex(index).managedReferenceValue = ((IComponentTemplate)obj).Clone();
|
||||||
componentsProp.GetArrayElementAtIndex(0).managedReferenceValue = ((IComponentTemplate)obj).Clone();
|
|
||||||
|
|
||||||
serializedObject.ApplyModifiedProperties();
|
serializedObject.ApplyModifiedProperties();
|
||||||
EditorUtility.SetDirty(this.target);
|
EditorUtility.SetDirty(this.target);
|
||||||
@ -104,10 +103,11 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
GUILayout.BeginVertical(UnityEditorUtility.GetStyle(Color.black, 0.2f));
|
GUILayout.BeginVertical(UnityEditorUtility.GetStyle(Color.black, 0.2f));
|
||||||
DrawTop(target);
|
DrawTop(target);
|
||||||
GUILayout.Label("", GUILayout.Height(0), GUILayout.ExpandWidth(true));
|
GUILayout.Label("", GUILayout.Height(0), GUILayout.ExpandWidth(true));
|
||||||
for (int i = 0; i < componentsProp.arraySize; i++)
|
for (int i = componentsProp.arraySize - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
DrawComponentData(componentsProp.GetArrayElementAtIndex(i), componentsProp.arraySize, i);
|
DrawComponentData(componentsProp.GetArrayElementAtIndex(i), componentsProp.arraySize, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
GUILayout.EndVertical();
|
GUILayout.EndVertical();
|
||||||
}
|
}
|
||||||
private void DrawTop(ITemplateInternal target)
|
private void DrawTop(ITemplateInternal target)
|
||||||
|
Loading…
Reference in New Issue
Block a user