mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2025-09-19 02:24:35 +08:00
fix ResetValues for SerializedProperty
This commit is contained in:
parent
a0f5129f3e
commit
c12fe06b2d
@ -117,6 +117,10 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
||||
private static Dictionary<Type, MonoScript> scriptsAssets = new Dictionary<Type, MonoScript>(256);
|
||||
|
||||
internal static void ResetValues(this SerializedProperty property, bool isExpand = false)
|
||||
{
|
||||
ResetValues_Internal(property.Copy(), isExpand, property.depth);
|
||||
}
|
||||
private static void ResetValues_Internal(SerializedProperty property, bool isExpand, int depth)
|
||||
{
|
||||
property.isExpanded = isExpand;
|
||||
switch (property.propertyType)
|
||||
@ -127,9 +131,11 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
||||
//InvalidOperationException: The operation is not possible when moved past all properties (Next returned false)
|
||||
//и не дает инструментов и шансов этого избежать
|
||||
{
|
||||
while (property.Next(true))
|
||||
bool x = true;
|
||||
while (property.Next(x) && property.depth > depth)
|
||||
{
|
||||
property.ResetValues(isExpand);
|
||||
ResetValues_Internal(property, isExpand, property.depth);
|
||||
x = false;
|
||||
}
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
Loading…
Reference in New Issue
Block a user