Ejemplo n.º 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();
                }
            }
        }
Ejemplo n.º 2
0
 private void DrawFileUI()
 {
     using (Disposables.VerticalScope(GUI.skin.box)) {
         EditorGUILayout.LabelField("File Name (Leave blank for name to be the date/time)");
         Owner.filename = EditorGUILayout.TextField(Owner.filename, GUILayout.ExpandWidth(true));
     }
 }
Ejemplo n.º 3
0
 private static void DrawData(FoCsDebug.Data data)
 {
     using (Disposables.VerticalScope(GUILayout.Width(ENTRY_WIDTH))) {
         FoCsGUI.Layout.LabelField(data.Value);
         FoCsGUI.Layout.LabelField($"Time: {data.Time}");
     }
 }
Ejemplo n.º 4
0
        private void DrawPathUI()
        {
            using (Disposables.VerticalScope(GUI.skin.box)) {
                EditorGUILayout.LabelField("Path");
                Owner.path = EditorGUILayout.TextField(Owner.path, GUILayout.ExpandWidth(true));
            }

            PathButtons();
        }
Ejemplo n.º 5
0
        public override void DrawTab(FoCsWindow <ScreenCapWindow> owner)
        {
            Owner = owner as ScreenCapWindow;

            using (Disposables.HorizontalScope()) {
                using (Disposables.VerticalScope()) {
                    DrawVariables();

                    using (Disposables.HorizontalScope())
                        DrawTakeImageGUI();
                }
            }
        }
            private void DrawFooter()
            {
                using (Disposables.VerticalScope()) {
                    if (FoCsGUI.Layout.Button("Force save"))
                    {
                        foreach (var serializedObject in Assets)
                        {
                            EditorUtility.SetDirty(serializedObject.targetObject);
                        }
                    }

                    using (Disposables.HorizontalScope(GUI.skin.box)) {
                        EditorGUILayout
                        .HelpBox("Warning, This window has not been tested for all the settings being validated.\nIt is still recommended to use the Unity settings windows.",
                                 MessageType.Warning);
                    }
                }
            }
Ejemplo n.º 7
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);
                    }
                }
            }
        }
Ejemplo n.º 8
0
        private void DrawChildrenGUI()
        {
            using (Disposables.Indent()) {
                var assets = AssetDatabase.LoadAllAssetsAtPath(AssetPath());

                if (assets.Length <= 1)
                {
                    return;
                }

                using (Disposables.HorizontalScope(FoCsGUI.Styles.Toolbar))
                    showChildrenSettings = FoCsGUI.Layout.Foldout(showChildrenSettings, $"Children [{assets.Length - 1}]");

                if (!showChildrenSettings)
                {
                    return;
                }

                using (Disposables.VerticalScope(GUI.skin.box)) {
                    for (var i = 0; i < assets.Length; i++)
                    {
                        var obj = assets[i];

                        if (!obj)
                        {
                            continue;
                        }

                        if (AssetDatabase.IsSubAsset(obj))
                        {
                            DrawChildObject(obj, i);
                        }

                        if (repaintCalled)
                        {
                            return;
                        }
                    }
                }
            }
        }