void DrawLevelListElement(Rect rect, int index, bool isActive, bool isFocused) { SerializedProperty element = levels.GetArrayElementAtIndex(index); rect.y += VerticalMargin; rect.height = SceneInfoDrawer.GetHeight(element.FindPropertyRelative("displayName")); EditorGUI.PropertyField(rect, element, GUIContent.none); }
public void OnEnable() { // Grab all serialized properties soundEffect = serializedObject.FindProperty("soundEffect"); splash = serializedObject.FindProperty("splash"); mainMenu = serializedObject.FindProperty("mainMenu"); credits = serializedObject.FindProperty("credits"); levels = serializedObject.FindProperty("levels"); // Setup level list levelList = new ReorderableList(serializedObject, levels, true, true, true, true); levelList.drawHeaderCallback = DrawLevelListHeader; levelList.drawElementCallback = DrawLevelListElement; levelList.elementHeight = SceneInfoDrawer.GetHeight() + VerticalMargin; }
float GetLeverListElementHeight(int index) { SerializedProperty element = levels.GetArrayElementAtIndex(index); return(SceneInfoDrawer.GetHeight(element.FindPropertyRelative("displayName")) + VerticalMargin); }