public void OnEnable()
        {
            objectsToPreload = serializedObject.FindProperty("objectsToPreload");

            objectsToPreloadList = new ReorderableList(serializedObject, objectsToPreload, true, true, true, true);
            objectsToPreloadList.drawHeaderCallback  = DrawObjectsToPreloadListHeader;
            objectsToPreloadList.drawElementCallback = DrawObjectsToPreloadListElement;
            objectsToPreloadList.elementHeight       = EditorUiUtility.SingleLineHeight(VerticalMargin);
        }
 private void CreateList(SerializedProperty property)
 {
     if ((list == null) || (this.property.serializedObject != property.serializedObject))
     {
         this.property             = property;
         list                      = new UnityEditorInternal.ReorderableList(property.serializedObject, property);
         list.headerHeight         = EditorUiUtility.VerticalMargin;
         list.drawElementCallback += DrawScene;
         list.elementHeight        = EditorUiUtility.SingleLineHeight(EditorUiUtility.VerticalMargin);
     }
 }
示例#3
0
        void OnEnable()
        {
            // Setup toggle
            toggleGenerateArea = true;
            toggleTestArea     = true;

            // Setup Reordable list
            allDomainsField = new ReorderableList(allDomains, typeof(string), true, true, true, true);
            allDomainsField.drawHeaderCallback  = DrawLevelListHeader;
            allDomainsField.drawElementCallback = DrawLevelListElement;
            allDomainsField.onAddCallback       = OnAddDomain;
            allDomainsField.elementHeight       = EditorUiUtility.SingleLineHeight(VerticalMargin);
        }
示例#4
0
        public CustomFileNameReorderableList(SerializedProperty names, SerializedProperty asSlug, GUIContent label)
        {
            // Member Variable
            NamesProperty  = names;
            AsSlugProperty = asSlug;
            Label          = label;

            // Setup List
            List = new ReorderableList(names.serializedObject, names, true, true, true, true);
            List.drawHeaderCallback    = DrawNamesListHeader;
            List.drawElementCallback   = DrawNamesListElement;
            List.onAddDropdownCallback = DrawNameListDropdown;
            List.elementHeight         = EditorUiUtility.SingleLineHeight(EditorUiUtility.VerticalMargin);
        }
        private ReorderableList GetFontsList(SerializedProperty property)
        {
            // Attempt to retrieve the list
            ReorderableList fontsList = null;

            if (fonts.TryGetValue(property, out fontsList) == false)
            {
                // If none is found, create a new one
                fontsList = new ReorderableList(serializedObject, property, true, true, true, true);
                fontsList.drawHeaderCallback  = DrawFontsListHeader;
                fontsList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
                {
                    DrawFontsListElement(property.GetArrayElementAtIndex(index), rect);
                };
                fontsList.elementHeight = EditorUiUtility.SingleLineHeight(EditorUiUtility.VerticalMargin);
                fonts.Add(property, fontsList);
            }
            return(fontsList);
        }
        public void OnEnable()
        {
            // Grab all serialized properties
            domainMustContain   = serializedObject.FindProperty("domainMustContain");
            remoteDomainListUrl = serializedObject.FindProperty("remoteDomainListUrl");
            domainDecrypter     = serializedObject.FindProperty("domainDecrypter");
            waitObjects         = serializedObject.FindProperty("waitObjects");
            forceRedirectIfDomainDoesntMatch = serializedObject.FindProperty("forceRedirectIfDomainDoesntMatch");
            redirectURL = serializedObject.FindProperty("redirectURL");

            // Setup domainMustContain list
            domainMustContainList = new ReorderableList(serializedObject, domainMustContain, true, true, true, true);
            domainMustContainList.drawHeaderCallback  = DrawDomainHeader;
            domainMustContainList.drawElementCallback = DrawDomainElement;
            domainMustContainList.elementHeight       = EditorUiUtility.SingleLineHeight(VerticalMargin);

            // Setup waitObjects list
            waitObjectsList = new ReorderableList(serializedObject, waitObjects, true, true, true, true);
            waitObjectsList.drawHeaderCallback  = DrawWaitHeader;
            waitObjectsList.drawElementCallback = DrawWaitElement;
            waitObjectsList.elementHeight       = EditorUiUtility.SingleLineHeight(VerticalMargin);
        }