/////////////////////////////////////////

        public static void DrawGUI()
        {
            //E.Load();
            P.Load();
            var targetGroupList = PlatformUtils.GetSupportList();

            ScopeIsCompile.Begin();

            ScopeVertical.Begin();
            HEditorGUILayout.HeaderTitle("Platform");
            GUILayout.Space(8);
            foreach (var t in targetGroupList)
            {
                ScopeChange.Begin();

                var _b = HEditorGUILayout.ToggleBox(P.GetPlatform(t).enable, t.Icon(), t.GetName());
                if (ScopeChange.End())
                {
                    P.GetPlatform(t).enable = _b;
                    P.Save();
                    BuildAssistWindow.ChangeActiveTarget();
                }
            }
            ScopeVertical.End();

            ScopeIsCompile.End();
        }
        public static void DrawGUI()
        {
            E.Load();
            P.Load();
            var targetGroupList = PlatformUtils.GetSupportList();

            ScopeIsCompile.Begin();

            ScopeVertical.Begin();
            HEditorGUILayout.HeaderTitle("Platform");
            GUILayout.Space(8);
            foreach (var t in targetGroupList)
            {
                ScopeChange.Begin();

                var _b = HEditorGUILayout.ToggleBox(P.i.supportPlatform[(int)t], t.Icon(), t.GetName());
                if (ScopeChange.End())
                {
                    P.i.supportPlatform[(int)t] = _b;
                    P.Save();
                    //BuildAssistWindow.ChangeActiveTarget();
                    Utils.m_treeView_EditorSymbols = null;
                }
            }
            ScopeVertical.End();

            ScopeIsCompile.End();
        }
Example #3
0
        public override void OnDefaultGUI()
        {
            //P.Load();
            //DrawToolBar();

            UnityEditorSplitterGUILayout.BeginHorizontalSplit(m_HorizontalSplitter);

            ScopeVertical.Begin();
            DrawLeftPane();
            ScopeVertical.End();

            ScopeVertical.Begin(HEditorStyles.dopesheetBackground);
            DrawRightPane();
            ScopeVertical.End();

            UnityEditorSplitterGUILayout.EndHorizontalSplit();
        }
        public static void DrawGUI()
        {
            var method1 = AssemblieUtils.GetAllMethodsWithAttribute <Hananoki_OnOpenAsset>().ToArray();

            Helper.New(ref E.i.m_enableOnOpen);

            foreach (var p in method1)
            {
                var cus = p.GetCustomAttributes(typeof(Hananoki_OnOpenAsset), false).OfType <Hananoki_OnOpenAsset>().ToList();
                //cus.Find(x=>)
                ScopeHorizontal.Begin(EditorStyles.helpBox);
                ScopeVertical.Begin(GUILayout.Height(40), GUILayout.Width(20));
                GUILayout.FlexibleSpace();

                var hash = p.GetHash_OnOpenAsset();
                int idx  = E.i.m_enableOnOpen.IndexOf(hash);

                ScopeChange.Begin();
                var _enable = EditorGUILayout.Toggle(0 <= idx, GUILayout.Width(20));
                if (ScopeChange.End())
                {
                    if (_enable)
                    {
                        E.i.m_enableOnOpen.Add(hash);
                    }
                    else
                    {
                        E.i.m_enableOnOpen.Remove(hash);
                    }
                    E.Save();
                    Association.MakeMethods(true);
                }

                GUILayout.FlexibleSpace();
                ScopeVertical.End();
                ScopeVertical.Begin();


                EditorGUILayout.LabelField(EditorHelper.TempContent($"{p.Name} : { cus[ 0 ].GetName()}", EditorIcon.assetIcon_CsScript));
                EditorGUI.indentLevel++;
                EditorGUILayout.LabelField(EditorHelper.TempContent($"{p.Module.Name}", EditorIcon.icons_processed_assembly_icon_asset));
                EditorGUI.indentLevel--;
                ScopeVertical.End();
                ScopeHorizontal.End();
            }
        }
Example #5
0
    //void OnDisable() {
    //	var tilemap = self.GetComponent<Tilemap>();
    //	if( tilemap ) {
    //		tilemap.color = ColorUtils.Alpha( tilemap.color, 1.0f );
    //	}
    //}

    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        var tilemap = self.GetComponent <Tilemap>();

        if (tilemap)
        {
            EditorGUILayout.LabelField("Tilemap", EditorStyles.boldLabel);
            EditorGUI.BeginChangeCheck();
            var a = EditorGUILayout.Slider("Alpha", tilemap.color.a, 0.00f, 1.00f);
            if (EditorGUI.EndChangeCheck())
            {
                tilemap.color = ColorUtils.RGBA(tilemap.color, a);
            }
        }

#if ENABLE_TILEMAP
        var window = EditorWindowUtils.Find(UnityTypes.UnityEditor_Tilemaps_GridPaintPaletteWindow);
        if (window == null)
        {
            return;
        }
        var clipboardView = window.GetProperty <object>("clipboardView");
        var _tileBase     = clipboardView.GetProperty <TileBase>("activeTile");
        if (_tileBase != m_tileBase)
        {
            m_tileBase       = _tileBase;
            m_tileBaseEditor = Editor.CreateEditor(m_tileBase);
        }
        if (m_tileBaseEditor != null)
        {
            ScopeVertical.Begin(EditorStyles.helpBox);
            ScopeHorizontal.Begin();
            EditorGUILayout.LabelField("Active Tile", EditorStyles.boldLabel);
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Delete"))
            {
                UnityObject.DestroyImmediate(_tileBase, true);
            }
            ScopeHorizontal.End();
            m_tileBaseEditor.OnInspectorGUI();
            ScopeVertical.End();
        }
#endif
    }
Example #6
0
        /////////////////////////////////////////
        public override void OnDefaultGUI()
        {
            ScopeIsCompile.Begin();

            DrawToolBar();

            var ww = (position.width - 40) * 0.5f;

            ScopeHorizontal.Begin();

            /////////////////////////////////////////
            ScopeVertical.Begin(GUILayout.Width(ww));
            DrawLeftPane();
            ScopeVertical.End();

            /////////////////////////////////////////
            ScopeVertical.Begin(HEditorStyles.dopesheetBackground, GUILayout.Width(40));
            GUILayout.FlexibleSpace();

            ScopeDisable.Begin(!m_treeViewL.HasSelection());
            if (GUILayout.Button(">>"))
            {
                m_treeViewL.選択パッケージをアンインストール指定する();
            }
            ScopeDisable.End();

            GUILayout.Space(16);
            ScopeDisable.Begin(!m_treeViewR.HasSelection());
            if (GUILayout.Button("<<"))
            {
                m_treeViewR.選択パッケージをインストール指定する();
            }
            ScopeDisable.End();

            GUILayout.FlexibleSpace();
            ScopeVertical.End();

            /////////////////////////////////////////
            ScopeVertical.Begin(HEditorStyles.dopesheetBackground, GUILayout.Width(ww));
            DrawRightPane();
            ScopeVertical.End();

            ScopeHorizontal.End();
            ScopeIsCompile.End();
        }
Example #7
0
        public override void OnDefaultGUI()
        {
            //////////////////////
            EditorGUILayout.LabelField("Assembly Definition References", EditorStyles.boldLabel);
            ScopeVertical.Begin(EditorStyles.helpBox);
            foreach (var e in m_reference)
            {
                e.toggle = HEditorGUILayout.ToggleLeft(e.asmname, e.toggle);
            }
            ScopeVertical.End();


            //////////////////////
            GUILayout.FlexibleSpace();
            ScopeHorizontal.Begin();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Apply"))
            {
                Apply();
            }
            GUILayout.Space(8);
            ScopeHorizontal.End();
            GUILayout.Space(8);
        }
Example #8
0
        static void DrawContentConfig()
        {
            ScopeChange.Begin();

            //PB.i.enableAssetBundleBuild = HEditorGUILayout.ToggleLeft( S._EnableAssetBundleBuild, PB.i.enableAssetBundleBuild );
            //HEditorGUI.DrawDebugRectAtLastRect();
            PB.i.enableOldStyleProjectSettings = HEditorGUILayout.ToggleLeft(S._Usingtheold_styleProjectSettings, PB.i.enableOldStyleProjectSettings);
            GUILayout.Space(8);
            PB.i.enableExlusionAssets = HEditorGUILayout.ToggleLeft(S._Enablingassetexclusionatbuildtime, PB.i.enableExlusionAssets);

            GUILayout.Label(S._ExclusionAssetsList, EditorStyles.boldLabel);

            if (s_exclusionContents == null)
            {
                if (PB.i.exclusionAssets == null)
                {
                    PB.i.exclusionAssets = new List <PB.ExclusionSets>();
                }

                //foreach(var p in PB.i.exclusionAssets ) {
                //	Debug.Log( GUIDUtils.GetAssetPath( p.GUID ) );
                //}
                s_exclusionContents = PB.i.exclusionAssets.Select(x => x.GUID.ToAssetPath()).OrderBy(value => value).Select(x => new GUIContent(x, AssetDatabase.GetCachedIcon(x))).ToArray();
            }

            int removeIndex = -1;

            ScopeVertical.Begin(EditorStyles.helpBox);
            for (int i = 0; i < s_exclusionContents.Length; i++)
            {
                var s = s_exclusionContents[i];
                ScopeHorizontal.Begin();
                GUILayout.Label(EditorHelper.TempContent(""), GUILayout.ExpandWidth(true), GUILayout.Height(18));
                ScopeHorizontal.End();

                var rc = GUILayoutUtility.GetLastRect();
                GUI.Box(rc, "", Styles.projectBrowserHeaderBgMiddle);
                GUI.Label(rc, s, Styles.labelAndIcon);
                rc.x     = rc.xMax - 16;
                rc.width = 16;
                if (HEditorGUI.IconButton(rc, EditorIcon.minus))
                {
                    removeIndex = i;
                }
            }
            GUILayout.FlexibleSpace();
            if (0 <= removeIndex)
            {
                var findGUID = s_exclusionContents[removeIndex].text.ToGUID();
                var rIndex   = PB.i.exclusionAssets.FindIndex(x => x.GUID == findGUID);
                PB.i.exclusionAssets.RemoveAt(rIndex);
                s_exclusionContents = null;
                s_changed           = true;
            }
            ScopeVertical.End();

            var dropRc = GUILayoutUtility.GetLastRect();
            var evt    = Event.current;

            switch (evt.type)
            {
            case EventType.DragUpdated:
            case EventType.DragPerform:
                if (!dropRc.Contains(evt.mousePosition))
                {
                    break;
                }

                DragAndDrop.visualMode = DragAndDropVisualMode.Copy;

                void AddFiles(params string[] paths)
                {
                    PB.i.exclusionAssets.AddRange(paths.Select(x => new PB.ExclusionSets(x.ToGUID(), x)).ToArray());
                    PB.i.exclusionAssets = PB.i.exclusionAssets.Distinct(x => x.GUID).ToList();
                    PB.Save();
                }

                string[] DirFiles(string path)
                {
                    return(DirectoryUtils.GetFiles(path, "*", SearchOption.AllDirectories).Where(x => x.Extension() != ".meta").ToArray());
                }

                if (evt.type == EventType.DragPerform)
                {
                    DragAndDrop.AcceptDrag();
                    if (DragAndDrop.paths.Length == 1)
                    {
                        if (Directory.Exists(DragAndDrop.paths[0]))
                        {
                            var m = new GenericMenu();
                            m.AddItem(S._Registerasafolder, false, (context) => {
                                AddFiles((string)context);
                            }, DragAndDrop.paths[0]);
                            m.AddItem(S._Registeringfilescontainedinafolder, false, (context) => {
                                AddFiles(DirFiles((string)context));
                                ;
                            }, DragAndDrop.paths[0]);
                            m.DropDownAtMousePosition();
                        }
                        else
                        {
                            AddFiles(DragAndDrop.paths);
                        }
                    }
                    else
                    {
                        bool dirChekc = false;
                        foreach (var s in DragAndDrop.paths)
                        {
                            if (Directory.Exists(s))
                            {
                                dirChekc = true;
                                break;
                            }
                        }
                        if (dirChekc)
                        {
                            var m = new GenericMenu();
                            m.AddItem(S._Registerasafolder, false, (context) => {
                                AddFiles((string[])context);
                            }, DragAndDrop.paths);
                            m.AddItem(S._Registeringfilescontainedinafolder, false, (context) => {
                                foreach (var s in ((string[])context))
                                {
                                    if (Directory.Exists(s))
                                    {
                                        AddFiles(DirFiles(s));
                                    }
                                    else
                                    {
                                        AddFiles(s);
                                    }
                                }
                            }, DragAndDrop.paths);
                            m.DropDownAtMousePosition();
                        }
                        else
                        {
                            AddFiles(DragAndDrop.paths);
                        }
                    }

                    DragAndDrop.activeControlID = 0;

                    s_exclusionContents = null;
                }
                s_changed = true;
                Event.current.Use();
                break;
            }

            if (ScopeChange.End())
            {
                s_changed = true;
            }
        }