SerializedPropertyExtension.cs 586 B

12345678910111213141516171819202122
  1. using UnityEditor;
  2. namespace Unity.RenderStreaming.Editor
  3. {
  4. static class SerializedPropertyExtension
  5. {
  6. public static SerializedProperty FindPropertyInChildren(this SerializedProperty target, string propertyName)
  7. {
  8. SerializedProperty property = null;
  9. while (target.Next(true))
  10. {
  11. if (target.name == propertyName)
  12. {
  13. property = target.Copy();
  14. break;
  15. }
  16. }
  17. target.Reset();
  18. return property;
  19. }
  20. }
  21. }