-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from mackysoft/fix/dropdown-overlap
Fix dropdown overlap in Unity 2023.2
- Loading branch information
Showing
4 changed files
with
88 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...s/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/SerializedPropertyExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#if UNITY_2019_3_OR_NEWER | ||
using System.Collections.Generic; | ||
using UnityEditor; | ||
|
||
namespace MackySoft.SerializeReferenceExtensions.Editor | ||
{ | ||
public static class SerializedPropertyExtensions | ||
{ | ||
public static IEnumerable<SerializedProperty> GetChildProperties (this SerializedProperty parent, int depth = 1) | ||
{ | ||
parent = parent.Copy(); | ||
|
||
int depthOfParent = parent.depth; | ||
var enumerator = parent.GetEnumerator(); | ||
|
||
while (enumerator.MoveNext()) | ||
{ | ||
if (enumerator.Current is not SerializedProperty childProperty) | ||
{ | ||
continue; | ||
} | ||
if (childProperty.depth > (depthOfParent + depth)) | ||
{ | ||
continue; | ||
} | ||
yield return childProperty.Copy(); | ||
} | ||
} | ||
} | ||
} | ||
#endif |
11 changes: 11 additions & 0 deletions
11
...kySoft/MackySoft.SerializeReferenceExtensions/Editor/SerializedPropertyExtensions.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters