1.8.0: Added AssetsOnly, SceneObjectsOnly, AssignAssetIfNull, AssignComponentIfNull

- Attributes: Added AssetsOnly, SceneObjectsOnly, AssignAssetIfNull, AssignComponentIfNull
- Attributes: Replaced AssignIfNull with AssignComponentIfNull
This commit is contained in:
Anders Ejlersen 2022-08-27 14:04:17 +02:00
parent 070b82767f
commit eb19150d98
23 changed files with 302 additions and 73 deletions

View file

@ -1,5 +1,4 @@
using System.Reflection;
using Module.Inspector.Editor.Utilities;
using Module.Inspector.Editor.Utilities;
using UnityEditor;
using UnityEngine;
@ -21,25 +20,20 @@ namespace Module.Inspector.Editor
if (!IsValidTarget())
return;
FieldInfo[] fields = EditorHiddenFieldUtility.Query(target);
EditorHiddenFieldUtility.EditableFieldInfo[] fields = EditorHiddenFieldUtility.Query(target);
if (fields.Length == 0)
return;
float totalHeight = EditorHiddenFieldUtility.CalculateHeight(fields) + EditorGUIUtility.singleLineHeight * 2;
GUILayout.Space(totalHeight);
var position = new Rect(0, 0, 1, 1);
if (Event.current.type == EventType.Repaint)
{
position = GUILayoutUtility.GetLastRect();
position.y -= totalHeight;
#if UNITY_2020_1_OR_NEWER
position.width = EditorGUIUtility.currentViewWidth - 22.0f;
#endif
}
Rect position = GUILayoutUtility.GetLastRect();
position.y -= totalHeight;
#if UNITY_2020_1_OR_NEWER
position.width = EditorGUIUtility.currentViewWidth - 22.0f;
#endif
position.y = position.yMax + EditorGUIUtility.singleLineHeight;
position.height = EditorGUIUtility.singleLineHeight;