mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2025-09-18 10:04:36 +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);
|
private static Dictionary<Type, MonoScript> scriptsAssets = new Dictionary<Type, MonoScript>(256);
|
||||||
|
|
||||||
internal static void ResetValues(this SerializedProperty property, bool isExpand = false)
|
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;
|
property.isExpanded = isExpand;
|
||||||
switch (property.propertyType)
|
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)
|
//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) { }
|
catch (Exception) { }
|
||||||
|
Loading…
Reference in New Issue
Block a user