public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { pAttributeTarget = (Rename_InspectorAttribute)attribute; Vector2 vecSize = CalculateSize(pAttributeTarget); return(vecSize.y); }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { pAttributeTarget = (Rename_InspectorAttribute)attribute; Vector2 vecSize = CalculateSize(pAttributeTarget); // Todo - 인스펙터 이름이 길어지면 재조정 label.text = pAttributeTarget.strInspectorName; GUI.enabled = pAttributeTarget.bIsEditPossibleInspector; EditorGUI.PropertyField(position, property, label, true); GUI.enabled = true; }
Vector2 CalculateSize(Rename_InspectorAttribute attribute) { return(GUI.skin.label.CalcSize(new GUIContent(attribute.strInspectorName))); }