コード例 #1
0
        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);
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        float GetLeverListElementHeight(int index)
        {
            SerializedProperty element = levels.GetArrayElementAtIndex(index);

            return(SceneInfoDrawer.GetHeight(element.FindPropertyRelative("displayName")) + VerticalMargin);
        }