예제 #1
0
        public override void OnGUI(Rect rect)
        {
            GUILayout.BeginArea(rect);
            {
                EditorGUILayout.LabelField($"Repeat Address({RepeatAddressDatas[0].assetAddress})", EGUIStyles.MiddleCenterLabel);
                scrollPos = EditorGUILayout.BeginScrollView(scrollPos, EditorStyles.helpBox);
                {
                    for (int i = 0; i < RepeatAddressDatas.Length; i++)
                    {
                        EditorGUILayout.BeginHorizontal();
                        {
                            EditorGUILayout.LabelField("" + i, EGUIStyles.MiddleLeftLabelStyle, GUILayout.Width(20), GUILayout.Height(40));
                            EditorGUILayout.BeginVertical();
                            {
                                EGUI.BeginLabelWidth(60);
                                {
                                    EditorGUILayout.TextField("Path : ", RepeatAddressDatas[i].assetPath);

                                    UnityObject uObj = AssetDatabase.LoadAssetAtPath <UnityObject>(RepeatAddressDatas[i].assetPath);
                                    EditorGUILayout.ObjectField("Target:", uObj, typeof(UnityObject), false);
                                }
                                EGUI.EndLableWidth();
                            }
                            EditorGUILayout.EndVertical();
                        }
                        EditorGUILayout.EndHorizontal();
                    }
                }
                EditorGUILayout.EndScrollView();
            }
            GUILayout.EndArea();
        }
예제 #2
0
        private void DrawListViewDrag(Rect dragRect)
        {
            EGUI.DrawVerticalLine(dragRect, Color.grey, 2.0f);

            EditorGUIUtility.AddCursorRect(dragRect, MouseCursor.ResizeHorizontal);
            if (Event.current != null)
            {
                if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && dragRect.Contains(Event.current.mousePosition))
                {
                    isListViewDragging = true;

                    Event.current.Use();
                    Repaint();
                }
                else if (isListViewDragging && Event.current.type == EventType.MouseDrag)
                {
                    listViewWidth += Event.current.delta.x;
                    if (listViewWidth < MIN_LISTVIEW_WIDTH)
                    {
                        listViewWidth = MIN_LISTVIEW_WIDTH;
                    }
                    else if (listViewWidth > MAX_LISTVIEW_WIDTH)
                    {
                        listViewWidth = MAX_LISTVIEW_WIDTH;
                    }
                    Repaint();
                }
                else if (isListViewDragging && Event.current.type == EventType.MouseUp)
                {
                    isListViewDragging = false;
                    Event.current.Use();
                    Repaint();
                }
            }
        }
예제 #3
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            SerializedProperty scriptPathProperty  = property.FindPropertyRelative("scriptPath");
            SerializedProperty paramValuesProperty = property.FindPropertyRelative("paramValues");

            Rect headerRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);

            EGUI.DrawBoxHeader(headerRect, label.text);

            Rect scriptRect = headerRect;

            scriptRect.y     += headerRect.height;
            scriptRect.height = EditorGUIUtility.singleLineHeight * 2;
            DrawScriptProperty(scriptRect, scriptPathProperty);

            Rect paramValuesRect = scriptRect;

            paramValuesRect.y     += scriptRect.height;
            paramValuesRect.height = position.height - headerRect.height - scriptRect.height;

            string paramValuesPropertyPath = paramValuesProperty.propertyPath;

            if (!rListDic.TryGetValue(paramValuesPropertyPath, out var rList))
            {
                rList = new ReorderableListProperty(paramValuesProperty);
                rListDic.Add(paramValuesPropertyPath, rList);
            }
            rList.OnGUI(paramValuesRect);
        }
예제 #4
0
        private void DrawProperty(Rect propertyRect)
        {
            EGUI.DrawAreaLine(propertyRect, Color.gray);

            LineSetting setting = LineSetting.Setting;

            Rect titleRect = new Rect(propertyRect.x, propertyRect.y, propertyRect.width, TRACK_TITLE_HEIGHT);

            EditorGUI.LabelField(titleRect, "Property", EditorStyles.toolbar);

            if (Data == null)
            {
                return;
            }

            Rect contentRect = new Rect(propertyRect.x, propertyRect.y + TRACK_TITLE_HEIGHT, propertyRect.width, propertyRect.height - TRACK_TITLE_HEIGHT);

            GUILayout.BeginArea(contentRect);
            {
                Data.TimeLength = EditorGUILayout.FloatField("Time Length", Data.TimeLength);

                EditorGUILayout.Space();

                if (selectedTrackIndex >= 0)
                {
                    trackDrawers[selectedTrackIndex].OnDrawProperty(contentRect);
                }
            }
            GUILayout.EndArea();
        }
예제 #5
0
        void OnGUI()
        {
            if (fontConfigListView == null)
            {
                fontConfigListView = new EGUIListView <BitmapFontConfig>();
                fontConfigListView.AddItems(fontConfigs.ToArray());
                fontConfigListView.OnSelectedChange = (index) =>
                {
                    SelectedChanged(index);
                };
            }

            Rect toolbarRect = new Rect(0, 0, position.width, TOOLBAR_HEIGHT);

            DrawToolbar(toolbarRect);

            Rect listViewRect = new Rect(0, TOOLBAR_HEIGHT, listViewWidth, position.height - TOOLBAR_HEIGHT);

            DrawListView(listViewRect);

            EGUI.DrawAreaLine(listViewRect, Color.grey);

            Rect listViewDragRect = new Rect(listViewRect.x + listViewRect.width, listViewRect.y, LISTVIEW_DRAG_WIDTH, listViewRect.height);

            DrawListViewDrag(listViewDragRect);

            EGUI.DrawAreaLine(listViewDragRect, Color.grey);

            Rect contentRect = new Rect(listViewDragRect.x + listViewDragRect.width, listViewRect.y, position.width - listViewDragRect.x - listViewDragRect.width, listViewRect.height);

            DrawContent(contentRect);

            EGUI.DrawAreaLine(contentRect, Color.grey);
        }
예제 #6
0
        internal void OnGUI(Rect rect)
        {
            Rect titleRect = new Rect(rect.x, rect.y, rect.width, TITLE_HEIGHT);

            EGUI.DrawBoxHeader(titleRect, Contents.titleStr, EGUIStyles.BoxedHeaderCenterStyle);

            Track trackData = EditorData.Data.GetSelectedTrack();

            if (trackData == null)
            {
                return;
            }

            Rect scrollRect = new Rect(rect.x, titleRect.y + titleRect.height, rect.width, rect.height - titleRect.height);

            GUILayout.BeginArea(scrollRect);
            {
                EGUI.BeginLabelWidth(100);
                {
                    trackData.Name = EditorGUILayout.TextField(Contents.nameContent, trackData.Name);
                }
                EGUI.EndLableWidth();
            }
            GUILayout.EndArea();
        }
예제 #7
0
        void OnGUI()
        {
            Rect rect = new Rect(0, 0, position.width, position.height);

            Rect toolbarRect = new Rect(rect.x, rect.y, position.width, TOOLBAR_HEIGHT);

            EditorGUI.LabelField(toolbarRect, GUIContent.none, EditorStyles.toolbar);
            DrawToolbar(toolbarRect);

            Rect dataListRect = new Rect(rect.x + LINE_THINKNESS, rect.y + TOOLBAR_HEIGHT + LINE_THINKNESS,
                                         DATA_LIST_WIDTH - LINE_THINKNESS * 2, rect.height - TOOLBAR_HEIGHT - LINE_THINKNESS * 2);

            dataListView.OnGUI(dataListRect);

            Rect skeletonRect = new Rect(dataListRect.x + dataListRect.width, dataListRect.y, (rect.width - dataListRect.width) * 0.4f, dataListRect.height);

            EGUI.DrawAreaLine(skeletonRect, Color.black);
            DrawSkeleton(skeletonRect);

            Rect partRect = new Rect(skeletonRect.x + skeletonRect.width, dataListRect.y, (rect.width - dataListRect.width) * 0.6f, dataListRect.height);

            EGUI.DrawAreaLine(partRect, Color.black);
            DrawParts(partRect);

            if (GUI.changed && currentCreatorData != null)
            {
                EditorUtility.SetDirty(currentCreatorData);
            }
        }
예제 #8
0
        private void DrawLine(Rect lineRect)
        {
            EGUI.DrawAreaLine(lineRect, Color.gray);

            Rect rulerRect = new Rect(lineRect.x, lineRect.y, lineRect.width, LINE_RULER_HEIGHT);

            EditorGUI.LabelField(rulerRect, GUIContent.none, EditorStyles.toolbar);
            DrawLineRuler(rulerRect);

            Rect gridRect = new Rect(lineRect.x, lineRect.y + LINE_RULER_HEIGHT, lineRect.width, lineRect.height - LINE_RULER_HEIGHT);

            DrawLineGrid(gridRect);

            if (Data != null)
            {
                DrawTrackline(gridRect);

                LineSetting setting = LineSetting.Setting;
                using (new GUILayout.AreaScope(gridRect))
                {
                    using (var scop = new UnityEditor.EditorGUILayout.ScrollViewScope(setting.ScrollPos))
                    {
                        float scrollWith   = Mathf.Max(Data.TimeLength * setting.WidthForSecond, gridRect.width);
                        float scrollHeight = Mathf.Max(Data.Tracks.Count * setting.TracklineHeight, gridRect.height);

                        GUILayout.Label("", GUILayout.Width(scrollWith), GUILayout.Height(scrollHeight - 20));

                        setting.ScrollPos = scop.scrollPosition;
                    }
                }
            }
        }
예제 #9
0
        private void DrawTrackline(Rect lineRect)
        {
            LineSetting setting = LineSetting.Setting;

            using (new GUI.ClipScope(lineRect))
            {
                int startY = Mathf.FloorToInt(setting.ScrollPosY / setting.TracklineHeight);
                int endY   = Mathf.CeilToInt((setting.ScrollPosY + lineRect.height) / setting.TracklineHeight);

                float maxWidth = Data.TimeLength * setting.WidthForSecond;

                for (int i = startY; i < endY; ++i)
                {
                    float y = setting.TracklineHeight * i - setting.ScrollPosY;

                    if (i >= trackDrawers.Count)
                    {
                        break;
                    }

                    Rect tRect = new Rect(0, y, lineRect.width, setting.TracklineHeight);
                    tRect.width = Mathf.Min(lineRect.width, maxWidth - setting.ScrollPosX);
                    if (selectedTrackIndex == i)
                    {
                        EGUI.DrawAreaLine(tRect, Color.green);
                    }

                    trackDrawers[i].OnDrawGUI(tRect);
                }
            }
        }
예제 #10
0
        protected override void OnDrawColumnItem(Rect rect, int columnIndex, GridViewData columnItemData)
        {
            LogData logData = columnItemData.Userdata as LogData;

            Color textColor = Color.white;

            if (m_LogColorDic.TryGetValue(logData.Level, out textColor))
            {
            }
            EGUI.BeginGUIColor(textColor);
            {
                if (columnIndex == 0)
                {
                    GUI.Label(rect, logData.Level.ToString());
                }
                else if (columnIndex == 1)
                {
                    GUI.Label(rect, new DateTime(logData.Time).ToString());
                }
                else if (columnIndex == 2)
                {
                    GUI.Label(rect, logData.Tag);
                }
                else if (columnIndex == 3)
                {
                    GUI.Label(rect, logData.Message);
                }
                else if (columnIndex == 4)
                {
                    GUI.Label(rect, logData.StackTrace);
                }
            }
            EGUI.EndGUIColor();
        }
        public override void OnInspectorGUI()
        {
            EGUILayout.DrawScript(target);

            EditorGUILayout.Space();

            EGUI.BeginGUIColor(Color.grey);
            {
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    EGUILayout.DrawBoxHeader("Native Drawer Setting", GUILayout.ExpandWidth(true));
                    EGUI.BeginIndent();
                    {
                        NativeDrawerSetting.IsShowHelp = EditorGUILayout.Toggle("Is Show Help", NativeDrawerSetting.IsShowHelp);
                    }
                    EGUI.EndIndent();
                }
                EditorGUILayout.EndVertical();
            }
            EGUI.EndGUIColor();

            EditorGUILayout.Space();

            EGUI.BeginLabelWidth(GetLabelWidth());
            {
                drawerObject.OnGUILayout();
            }
            EGUI.EndLableWidth();
        }
예제 #12
0
        public override void OnGUILayout()
        {
            var attr = GetAttr <ButtonAttribute>();

            if (string.IsNullOrEmpty(attr.MethodName))
            {
                EGUI.BeginGUIColor(Color.red);
                {
                    EditorGUILayout.LabelField("The name of the method can't be empty.");
                }
                EGUI.EndGUIColor();
            }
            else
            {
                string btnContentStr = string.IsNullOrEmpty(attr.Label) ? attr.MethodName : attr.Label;
                float  height        = EGUIUtility.singleLineHeight;
                if (attr.Size == ButtonSize.Big)
                {
                    height *= 2;
                }
                else if (attr.Size == ButtonSize.Normal)
                {
                    height *= 1.5f;
                }
                if (GUILayout.Button(btnContentStr, GUILayout.Height(height)))
                {
                    MethodInfo methodInfo = Property.TargetType.GetMethod(attr.MethodName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
                    if (methodInfo != null)
                    {
                        methodInfo.Invoke(Property.Target, null);
                    }
                }
            }
        }
예제 #13
0
        private void OnGUI()
        {
            if (searchField == null)
            {
                searchField = new SearchField();
                searchField.autoSetFocusOnFindCommand = true;
            }

            Rect toolbarRect = new Rect(0, 0, position.width, TOOLBAR_HEIGHT);

            DrawToolbar(toolbarRect);

            Rect tabRect = toolbarRect;

            tabRect.y     += tabRect.height;
            tabRect.height = TOOLBAR_BTN_HEIGHT;

            toolbarSelectedIndex = GUI.Toolbar(tabRect, toolbarSelectedIndex, toolbarContents);

            Rect contentRect = new Rect(tabRect.x + 1, tabRect.y + tabRect.height + 1, position.width - 2, position.height - tabRect.y - tabRect.height - 2);

            EGUI.DrawAreaLine(contentRect, Color.black);
            tabViewers[toolbarSelectedIndex].OnGUI(contentRect);

            if (GUI.changed)
            {
                EditorUtility.SetDirty(genConfig);
            }
        }
 protected virtual void DrawInvalidContent()
 {
     EGUI.BeginGUIColor(Color.red);
     {
         EditorGUILayout.LabelField(ItemDrawer.Label, "Invalid");
     }
     EGUI.EndGUIColor();
 }
예제 #15
0
 protected virtual void OnDrawInvalidProperty(string label)
 {
     EGUI.BeginGUIColor(Color.red);
     {
         EditorGUILayout.LabelField(string.IsNullOrEmpty(label) ? "" : label, "Invalid");
     }
     EGUI.EndGUIColor();
 }
 public override void OnGUILayout()
 {
     EGUI.BeginGUIColor(Color.red);
     {
         EditorGUILayout.LabelField(Label, $"The \"{TargetType.Name}\" is not supported!");
     }
     EGUI.EndGUIColor();
 }
예제 #17
0
 protected void DrawSpriteAtlas()
 {
     DrawAtlasPopupLayout(new GUIContent("Sprite Atlas"), new GUIContent("----"), m_SpriteAtlas);
     EGUI.BeginIndent();
     {
         DrawSpritePopup(m_SpriteAtlas.objectReferenceValue as SpriteAtlas, m_SpriteName);
     }
     EGUI.EndIndent();
 }
예제 #18
0
        public void OnGUI(Rect rect)
        {
            if (!string.IsNullOrEmpty(HeaderContent))
            {
                EGUI.DrawBoxHeader(new Rect(rect.x, rect.y, rect.width, HEADER_HEIGHT), HeaderContent, EGUIStyles.BoxedHeaderCenterStyle);
            }

            rect.height -= HEADER_HEIGHT;

            treeView?.OnGUI(rect);
        }
예제 #19
0
        public override void OnInspectorGUI()
        {
            EGUILayout.DrawScript(target);
            DrawerSetting.OnDrawSetting();

            EGUI.BeginLabelWidth(GetLabelWidth());
            {
                drawerObject.OnGUILayout();
            }
            EGUI.EndLableWidth();
        }
예제 #20
0
        public override void OnGUI(Rect rect)
        {
            Rect viewRect = rect;

            if (!string.IsNullOrEmpty(listView.Header))
            {
                EGUI.DrawBoxHeader(new Rect(rect.x, rect.y, rect.width, 30), listView.Header, EGUIStyles.BoxedHeaderCenterStyle);
                viewRect.y      += 20;
                viewRect.height -= 20;
            }
            base.OnGUI(viewRect);
        }
예제 #21
0
 public void OnGUILayout()
 {
     EditorGUI.BeginDisabledGroup(!Enable);
     {
         EGUI.BeginLabelWidth(LabelWidth);
         {
             OnLayoutDraw();
         }
         EGUI.EndLableWidth();
     }
     EditorGUI.EndDisabledGroup();
 }
        private void DrawAddressData(Rect contentRect, PackerAssetData assetData)
        {
            EGUI.DrawAreaLine(contentRect, Color.black);

            Rect pingBtnRect = new Rect(contentRect.x + contentRect.width - contentRect.height * 2, contentRect.y, contentRect.height * 2, contentRect.height);

            if (GUI.Button(pingBtnRect, "Ping"))
            {
                SelectionUtility.PingObject(assetData.Path);
            }

            Rect ValueRect = new Rect(contentRect.x, contentRect.y, contentRect.width - contentRect.height * 2, contentRect.height);

            Rect drawRect = new Rect(ValueRect.x, ValueRect.y, ValueRect.width * 0.5f, ValueRect.height * 0.5f);

            EGUI.BeginLabelWidth(80);
            {
                EditorGUI.TextField(drawRect, "path", assetData.Path);
            }
            EGUI.EndLableWidth();

            drawRect = new Rect(ValueRect.x, ValueRect.y + drawRect.height, ValueRect.width * 0.5f, ValueRect.height * 0.5f);
            EGUI.BeginLabelWidth(80);
            {
                EditorGUI.TextField(drawRect, "address", assetData.Address);
            }
            EGUI.EndLableWidth();

            drawRect = new Rect(ValueRect.x + ValueRect.width * 0.5f, ValueRect.y, ValueRect.width * 0.5f, ValueRect.height * 0.5f);
            EGUI.BeginLabelWidth(80);
            {
                EditorGUI.TextField(drawRect, "labels", string.Join(",", assetData.Labels));
            }
            EGUI.EndLableWidth();

            drawRect = new Rect(ValueRect.x + ValueRect.width * 0.5f, ValueRect.y + drawRect.height, ValueRect.width * 0.5f, ValueRect.height * 0.5f);
            EGUI.BeginLabelWidth(80);
            {
            }
            EGUI.EndLableWidth();
            //if (Window.IsAddressRepeated(assetData.Address, out List<PackerBundleData> datas))
            //{
            //    if (GUI.Button(drawRect,addressRepeatContent))
            //    {
            //        AssetAddressRepeatPopupContent content = new AssetAddressRepeatPopupContent()
            //        {
            //            RepeatAddressDatas = datas.ToArray(),
            //        };
            //        PopupWindow.Show(drawRect, content);
            //    }
            //}
        }
예제 #23
0
        protected override void OnDrawRowItem(Rect rect, GridViewData itemData)
        {
            Rect drawRect = rect;

            if (ShowSeparator)
            {
                drawRect.height -= SEPARATOR_LINE_HEIGHT;
            }
            EditorGUI.LabelField(drawRect, itemData.DisplayName);

            drawRect.y     += drawRect.height;
            drawRect.height = SEPARATOR_LINE_HEIGHT;
            EGUI.DrawHorizontalLine(drawRect);
        }
        private ReorderableList CreateRList(string propertyName)
        {
            SerializedProperty property = serializedObject.FindProperty(propertyName);
            ReorderableList    rList    = new ReorderableList(serializedObject, property, true, true, true, true);

            rList.drawHeaderCallback = (rect) =>
            {
                EditorGUI.LabelField(rect, ObjectNames.NicifyVariableName(propertyName), EGUIStyles.MiddleLeftLabelStyle);
            };
            rList.elementHeight = Styles.LIST_HEIGHT;
            rList.onAddCallback = (list) =>
            {
                property.InsertArrayElementAtIndex(property.arraySize);
            };
            rList.drawElementCallback = (rect, index, isActive, isFocused) =>
            {
                SerializedProperty elementProperty = property.GetArrayElementAtIndex(index);

                SerializedProperty enumProperty      = elementProperty.FindPropertyRelative("Name");
                SerializedProperty smallIconProperty = elementProperty.FindPropertyRelative("SmallIcon");
                SerializedProperty largeIconProperty = elementProperty.FindPropertyRelative("LargeIcon");

                EGUI.BeginLabelWidth(80);
                {
                    Rect drawRect = rect;
                    drawRect.width -= Styles.LARGE_ICON_SIZE;
                    drawRect.height = Styles.LINE_HEIGHT;
                    EditorGUI.PropertyField(drawRect, enumProperty);

                    drawRect.y += drawRect.height;
                    EditorGUI.PropertyField(drawRect, smallIconProperty);

                    drawRect.y += drawRect.height;
                    EditorGUI.PropertyField(drawRect, largeIconProperty);
                }
                EGUI.EndLableWidth();

                Rect previewRect = rect;
                previewRect.x     += previewRect.width - Styles.LARGE_ICON_SIZE;
                previewRect.width  = Styles.LARGE_ICON_SIZE;
                previewRect.height = Styles.LARGE_ICON_SIZE;
                UnityEngine.GUI.DrawTexture(previewRect, (Texture2D)largeIconProperty.objectReferenceValue ?? EGUIResources.DefaultFolderIcon);

                previewRect.y    += previewRect.height - Styles.SMALL_ICON_SIZE;
                previewRect.width = previewRect.height = Styles.SMALL_ICON_SIZE;
                UnityEngine.GUI.DrawTexture(previewRect, (Texture2D)smallIconProperty.objectReferenceValue ?? EGUIResources.DefaultFolderIcon);
            };

            return(rList);
        }
예제 #25
0
 public override void OnGUI(Rect rect)
 {
     GUILayout.BeginArea(rect);
     {
         EGUILayout.DrawBoxHeader("Setting", EGUIStyles.BoxedHeaderCenterStyle, GUILayout.ExpandWidth(true));
         EditorGUILayout.Space();
         scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
         {
             if (m_Setting != null)
             {
                 EditorGUI.BeginChangeCheck();
                 {
                     m_Setting.GlobalSetting.GlobalLogLevel = (LogLevel)EditorGUILayout.EnumPopup("Global Log Level:", m_Setting.GlobalSetting.GlobalLogLevel);
                 }
                 if (EditorGUI.EndChangeCheck())
                 {
                     LogViewer.Viewer.ChangeGlobalLogLevel(m_Setting.GlobalSetting.GlobalLogLevel);
                 }
                 if (m_Setting.LoggerSettings.Count > 0)
                 {
                     EditorGUILayout.LabelField("Logger Log Level:");
                     EGUI.BeginIndent();
                     {
                         foreach (var loggerSetting in m_Setting.LoggerSettings)
                         {
                             EditorGUI.BeginChangeCheck();
                             {
                                 EditorGUILayout.LabelField(loggerSetting.Name);
                                 EGUI.BeginIndent();
                                 {
                                     loggerSetting.MinLogLevel        = (LogLevel)EditorGUILayout.EnumPopup("Min Log Level:", loggerSetting.MinLogLevel);
                                     loggerSetting.StackTraceLogLevel = (LogLevel)EditorGUILayout.EnumPopup("StackTrace Log Level:", loggerSetting.StackTraceLogLevel);
                                 }
                                 EGUI.EndIndent();
                             }
                             if (EditorGUI.EndChangeCheck())
                             {
                                 LogViewer.Viewer.ChangeLoggerLogLevel(loggerSetting.Name, loggerSetting.MinLogLevel, loggerSetting.StackTraceLogLevel);
                             }
                         }
                     }
                     EGUI.EndIndent();
                 }
             }
         }
         EditorGUILayout.EndScrollView();
     }
     GUILayout.EndArea();
 }
예제 #26
0
        protected virtual void OnEnable()
        {
            Configer = new EAssetBundleToolConfig();
            Configer.LoadConfig();

            Pages = new Dictionary <string, EGUI>();
            Pages.Add("AssetBundleNameConfig", new EPageNameConfig(Configer));
            Pages.Add("Main", new EPageMain(Configer, OnSetModuleName, OnClearModuleName, IsInvalidFile));

            ToolBar = new EGUIToolBar(new string[] {
                "Main",
                "AssetBundleNameConfig"
            }, 0,
                                      (choose) => {
                CurrentPage = Pages[choose];
            });
        }
예제 #27
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            var targetObject      = (AdaptiveAspectRatioFitterEnabler)serializedObject.targetObject;
            var propertiesChanged = false;

            EGUI.Horizontally(() =>
            {
                EGUI.Label("Enabled on Interfaces", 200);
                EGUI.Enum(targetObject.interfaceType, EnumRenderMode.DropDown, valueNew =>
                {
                    targetObject.interfaceType = (InterfaceType)valueNew;
                    propertiesChanged          = true;
                });
            });

            EGUI.Horizontally(() =>
            {
                EGUI.Label("Stretch", 200);
                EGUI.Checkbox(targetObject.stretch, valueNew =>
                {
                    targetObject.stretch = valueNew;
                    propertiesChanged    = true;
                });
            });

            EGUI.Horizontally(() =>
            {
                EGUI.Label("Reset offsets when ARF disabled", 200);
                EGUI.Checkbox(targetObject.resetOffsetsWhenAspectRationFitterDisabled, valueNew =>
                {
                    targetObject.resetOffsetsWhenAspectRationFitterDisabled = valueNew;
                    propertiesChanged = true;
                });
            });

            serializedObject.ApplyModifiedProperties();

            if (propertiesChanged)
            {
                targetObject.SendMessage("OnValidate", null, SendMessageOptions.DontRequireReceiver);
                EditorUtility.SetDirty(targetObject);
            }
        }
예제 #28
0
        protected override void OnDrawProperty(string label)
        {
            if (drawerObject == null)
            {
                drawerObject = new DrawerObject(Property.Value);
            }
            if (Property.IsArrayElement)
            {
                AvatarPartCreatorData partCreatorData = (AvatarPartCreatorData)Property.Value;
                EditorGUILayout.BeginHorizontal();
                {
                    EditorGUILayout.LabelField(label, UnityEngine.GUILayout.Width(25));
                    EditorGUILayout.BeginVertical();
                    {
                        drawerObject.OnGUILayout();
                    }
                    EditorGUILayout.EndVertical();
                }
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.Space();

                EGUI.BeginGUIBackgroundColor(Color.cyan);
                {
                    if (GUILayout.Button("Create Part"))
                    {
                        CreatePartBtnClick?.Invoke(partCreatorData);
                    }
                    if (GUILayout.Button("Preview Part"))
                    {
                        PreviewPartBtnClick?.Invoke(partCreatorData);
                    }
                }
                EGUI.EndGUIBackgroundColor();
            }
            else
            {
                EditorGUILayout.LabelField(label);
                EditorGUI.indentLevel++;
                {
                    drawerObject.OnGUILayout();
                }
                EditorGUI.indentLevel--;
            }
        }
예제 #29
0
        private void DrawPackOperation()
        {
            if (bundleBuildConfig == null)
            {
                bundleBuildConfig = AssetPackerUtil.ReadBuildData();
            }

            EditorGUILayout.BeginVertical(EditorStyles.helpBox, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true));
            {
                EditorGUILayout.LabelField(Contents.BuildTitleContent, EGUIStyles.MiddleCenterLabel);
                EditorGUI.BeginChangeCheck();
                {
                    EGUI.BeginLabelWidth(120);
                    {
                        bundleBuildConfig.OutputDir          = EGUILayout.DrawDiskFolderSelection(Contents.BuildOutputDirStr, bundleBuildConfig.OutputDir);
                        bundleBuildConfig.CleanupBeforeBuild = EditorGUILayout.Toggle(Contents.BuildCleanup, bundleBuildConfig.CleanupBeforeBuild);
                        bundleBuildConfig.PathFormat         = (BundlePathFormatType)EditorGUILayout.EnumPopup(Contents.BuildPathFormatContent, bundleBuildConfig.PathFormat);
                        EditorGUILayout.Space();
                        bundleBuildConfig.IsForceRebuild = EditorGUILayout.Toggle(Contents.ForceRebuild, bundleBuildConfig.IsForceRebuild);
                        bundleBuildConfig.Target         = (ValidBuildTarget)EditorGUILayout.EnumPopup(Contents.BuildTargetContent, bundleBuildConfig.Target);
                        bundleBuildConfig.Compression    = (CompressOption)EditorGUILayout.EnumPopup(Contents.BuildCompressionContent, bundleBuildConfig.Compression);
                    }
                    EGUI.EndLableWidth();
                }
                if (EditorGUI.EndChangeCheck())
                {
                    AssetPackerUtil.WriteBuildData(bundleBuildConfig);
                }

                GUILayout.FlexibleSpace();

                EGUI.BeginGUIBackgroundColor(Color.red);
                {
                    if (GUILayout.Button(Contents.OperationAutoBuildContent, GUILayout.Height(80), GUILayout.ExpandWidth(true)))
                    {
                        EditorApplication.delayCall += () =>
                        {
                            AssetPackerUtil.BuildAssetBundles(packerData, bundleBuildConfig);
                        };
                    }
                }
                EGUI.EndGUIBackgroundColor();
            }
            EditorGUILayout.EndVertical();
        }
예제 #30
0
        public override void OnInspectorGUI()
        {
            if (attr != null)
            {
                EGUILayout.DrawScript(target);
                DrawerSetting.OnDrawSetting();

                EGUI.BeginLabelWidth(attr.LabelWidth);
                {
                    drawerObject.OnGUILayout();
                }
                EGUI.EndLableWidth();
            }
            else
            {
                base.OnInspectorGUI();
            }
        }