private float GetExtraHeight(ActionEffectType type) { if (_extraHeight.ContainsKey(type)) { return(_extraHeight[type] * (EditorGUIUtility.singleLineHeight + ElementSpacing) - ElementSpacing); } return(0); }
private float GetHeight(SerializedProperty element) { float height = reorderableList.GetHeight(element); AbilityAction.Component component = (AbilityAction.Component)element.objectReferenceValue; ActionEffectType type = component.EffectType; if (_extraHeight.ContainsKey(type)) { height += GetExtraHeight(type); } return(height); }
private void DrawElement(Rect rect, SerializedProperty element, GUIContent label, bool selected, bool focused) { AbilityAction.Component component = (AbilityAction.Component)element.objectReferenceValue; ActionEffectType type = component.EffectType; rect.y += ElementSpacing; if (_extraInspector.ContainsKey(type)) { _extraInspector[type](rect, element); rect.y += GetExtraHeight(type); rect.height -= GetExtraHeight(type); } reorderableList.DrawElementInspector(rect, element, label, selected, focused); }