Beispiel #1
0
        private void DrawTop()
        {
            if (TitleBarScrollable)
            {
                using (Disposables.VerticalScope()) {
                    using (var scrollViewScope = Disposables.ScrollViewScope(scrollPos, true, GUILayout.ExpandWidth(true), GUILayout.Height(33))) {
                        scrollPos = scrollViewScope.scrollPosition;

                        using (Disposables.HorizontalScope(EditorStyles.toolbar, GUILayout.ExpandWidth(true)))
                            DrawHeaderGUI();
                    }

                    using (Disposables.VerticalScope(GUILayout.ExpandHeight(true)))
                        DrawActiveTab();
                }
            }
            else
            {
                using (Disposables.VerticalScope()) {
                    using (Disposables.HorizontalScope(EditorStyles.toolbar, GUILayout.ExpandWidth(true)))
                        DrawHeaderGUI();

                    using (Disposables.VerticalScope(GUILayout.ExpandHeight(true)))
                        DrawActiveTab();
                }
            }
        }
Beispiel #2
0
        protected override void OnGUI()
        {
            using (var scroll = Disposables.ScrollViewScope(ScrollPos, true)) {
                ScrollPos = scroll.scrollPosition;

                foreach (var data in FoCsDebug.DataDictionary)
                {
                    DrawField(data);
                }
            }
        }
Beispiel #3
0
        protected override void OnGUI()
        {
            if (ObjectsToEditors.IsNullOrEmpty())
            {
                ObjectsToEditors = new Dictionary <Object, UEditor>();
            }

            if (Object.IsNullOrEmpty())
            {
                Object = new List <Object>();
            }

            using (var scroll = Disposables.ScrollViewScope(scrollPos, true, FoCsGUI.LayoutOptions.Expand())) {
                scrollPos = scroll.scrollPosition;

                using (Disposables.HorizontalScope()) {
                    foreach (var o in Object)
                    {
                        if (!ObjectsToEditors.ContainsKey(o))
                        {
                            GenerateEditor(o);
                        }

                        using (Disposables.VerticalScope(FoCsGUI.LayoutOptions.Width(500)))
                            ObjectsToEditors[o].OnInspectorGUI();
                    }
                }
            }

            using (var cc = Disposables.ChangeCheck()) {
                var obj = FoCsGUI.Layout.ObjectField <Object>(null, Label, true);

                if (cc.changed)
                {
                    if (obj != null)
                    {
                        Object.AddWithDuplicateCheck(obj);
                        GenerateEditor(obj);
                    }
                }
            }
        }
            public override void DrawTab(FoCsWindow <AdvancedUnitySettingsWindow> owner)
            {
                //if(storage == null)
                //	storage = new UnityReorderableListStorage(owner);

                using (Disposables.HorizontalScope(GUI.skin.box))
                    EditorGUILayout.LabelField(TabName);

                using (Disposables.HorizontalScope()) {
                    DrawSpace(LEFT_BORDER * 0.5f);
                    Search = FoCsGUI.Layout.TextField(SearchGuiContent, Search);
                }

                using (Disposables.LabelAddWidth(EXTRA_LABEL_WIDTH)) {
                    using (Disposables.SetIndent(1)) {
                        //if(handlerControllers.IsNullOrEmpty())
                        //{
                        //	handlerControllers = new HandlerController[Assets.Length];
                        //
                        //	for(var i = 0; i < handlerControllers.Length; i++)
                        //		handlerControllers[i] = new HandlerController();
                        //}

                        for (var i = 0; i < Assets.Length; i++)
                        {
                            var asset = Assets[i];
                            //var handlerController = handlerControllers[i];
                            asset.Update();

                            //handlerController.VerifyIPropertyLayoutHandlerArrayNoObject(storage);
                            //handlerController.VerifyHandlingDictionary(asset);

                            using (Disposables.HorizontalScope()) {
                                DrawSpace(LEFT_BORDER);

                                using (var scrollViewScope = Disposables.ScrollViewScope(vector2, true)) {
                                    vector2 = scrollViewScope.scrollPosition;

                                    using (var changeCheckScope = Disposables.ChangeCheck()) {
                                        foreach (var property in asset.Properties())
                                        {
                                            if (Search.IsNullOrEmpty())
                                            {
                                                FoCsGUI.Layout.PropertyField(property);
                                            }
                                            else if (property.name.ToLower().Contains(Search.ToLower()))
                                            {
                                                FoCsGUI.Layout.PropertyField(property);
                                            }
                                        }

                                        if (changeCheckScope.changed)
                                        {
                                            asset.ApplyModifiedProperties();
                                        }
                                    }
                                }

                                DrawSpace(RIGHT_BORDER);
                            }
                        }
                    }
                }

                DrawFooter();
            }