Пример #1
0
        public override void OnInspectorGUI()
        {
            instance = target as TextureAssetTunerConfig;

            compressFolderView.DrawGUI();

            GUILayout.Space(2f);

            DrawRegisterIgnoreFolderNameGUI(ignoreCompressFolderNameScrollView, "Ignore Compress Folders");

            GUILayout.Space(2f);

            spriteFolderView.DrawGUI();

            GUILayout.Space(2f);

            DrawRegisterIgnoreFolderNameGUI(spriteFolderNameScrollView, "Sprite FolderName");

            GUILayout.Space(2f);

            DrawRegisterIgnoreFolderNameGUI(ignoreSpriteFolderNameScrollView, "Ignore Sprite Folders");

            GUILayout.Space(2f);

            EditorLayoutTools.Title("Options");

            using (new ContentsScope())
            {
                EditorGUI.BeginChangeCheck();

                changeSettingOnImport = EditorGUILayout.Toggle("Change setting on import", changeSettingOnImport);

                if (EditorGUI.EndChangeCheck())
                {
                    TextureAssetTunerConfig.Prefs.changeSettingOnImport = changeSettingOnImport;
                }

                GUILayout.Space(3f);

                EditorGUILayout.HelpBox("When this flag is enabled, the settings will be changed at the time of import..", MessageType.Info);
            }
        }
Пример #2
0
        public override void OnInspectorGUI()
        {
            instance = target as TextureAssetTunerConfig;

            compressFolderView.DrawGUI();

            GUILayout.Space(2f);

            DrawRegisterIgnoreFolderNameGUI(ignoreCompressFolderNameScrollView, "Ignore Compress FolderName");

            GUILayout.Space(2f);

            spriteFolderView.DrawGUI();

            GUILayout.Space(2f);

            DrawRegisterIgnoreFolderNameGUI(spriteFolderNameScrollView, "Sprite FolderName");

            GUILayout.Space(2f);

            DrawRegisterIgnoreFolderNameGUI(ignoreSpriteFolderNameScrollView, "Ignore Sprite FolderName");
        }
Пример #3
0
        //----- property -----

        //----- method -----

        void OnEnable()
        {
            instance = target as TextureAssetTunerConfig;

            lifetimeDisposable = new LifetimeDisposable();

            //------ Compress Folder ------

            compressFolderView = new FolderRegisterScrollView("Compress Folder", "TextureAssetTunerConfigInspector-CompressFolder");

            compressFolderView.RemoveChildrenFolder = true;

            compressFolderView.OnUpdateContentsAsObservable()
            .Subscribe(x => SaveCompressFolders(x.Select(y => y.asset).ToArray()))
            .AddTo(lifetimeDisposable.Disposable);

            compressFolderView.OnRepaintRequestAsObservable()
            .Subscribe(_ => Repaint())
            .AddTo(lifetimeDisposable.Disposable);

            compressFolderView.SetContents(instance.CompressFolders);

            //------ Sprite Folder ------

            spriteFolderView = new FolderRegisterScrollView("Sprite Folder", "TextureAssetTunerConfigInspector-SpriteFolder");

            spriteFolderView.RemoveChildrenFolder = true;

            spriteFolderView.OnUpdateContentsAsObservable()
            .Subscribe(x => SaveSpriteFolders(x.Select(y => y.asset).ToArray()))
            .AddTo(lifetimeDisposable.Disposable);

            spriteFolderView.OnRepaintRequestAsObservable()
            .Subscribe(_ => Repaint())
            .AddTo(lifetimeDisposable.Disposable);

            spriteFolderView.SetContents(instance.SpriteFolders);

            //------ Ignore Compress FolderName ------

            ignoreCompressFolderNameScrollView = new FolderNameRegisterScrollView();

            ignoreCompressFolderNameScrollView.OnUpdateContentsAsObservable()
            .Subscribe(x => SaveIgnoreCompressFolderNames(x))
            .AddTo(lifetimeDisposable.Disposable);

            ignoreCompressFolderNameScrollView.OnRepaintRequestAsObservable()
            .Subscribe(_ => Repaint())
            .AddTo(lifetimeDisposable.Disposable);

            ignoreCompressFolderNameScrollView.SetContents(instance.IgnoreCompressFolderNames);

            //------ Sprite Folder Name ------

            spriteFolderNameScrollView = new FolderNameRegisterScrollView();

            spriteFolderNameScrollView.OnUpdateContentsAsObservable()
            .Subscribe(x => SaveSpriteFolderNames(x))
            .AddTo(lifetimeDisposable.Disposable);

            spriteFolderNameScrollView.OnRepaintRequestAsObservable()
            .Subscribe(_ => Repaint())
            .AddTo(lifetimeDisposable.Disposable);

            spriteFolderNameScrollView.SetContents(instance.SpriteFolderNames);

            //------ Ignore Sprite FolderName ------

            ignoreSpriteFolderNameScrollView = new FolderNameRegisterScrollView();

            ignoreSpriteFolderNameScrollView.OnUpdateContentsAsObservable()
            .Subscribe(x => SaveIgnoreSpriteFolderNames(x))
            .AddTo(lifetimeDisposable.Disposable);

            ignoreSpriteFolderNameScrollView.OnRepaintRequestAsObservable()
            .Subscribe(_ => Repaint())
            .AddTo(lifetimeDisposable.Disposable);

            ignoreSpriteFolderNameScrollView.SetContents(instance.IgnoreSpriteFolderNames);
        }
Пример #4
0
        //----- property -----

        //----- method -----

        void OnEnable()
        {
            instance = target as TextureAssetTunerConfig;

            lifetimeDisposable = new LifetimeDisposable();

            //------ Compress Folder ------

            compressFolderView = new FolderRegisterScrollView("Compress Folder", "TextureAssetTunerConfigInspector-CompressFolder");

            compressFolderView.RemoveChildrenFolder = true;

            compressFolderView.OnUpdateContentsAsObservable()
            .Subscribe(x => SaveCompressFolders(x.Select(y => y.asset).ToArray()))
            .AddTo(lifetimeDisposable.Disposable);

            var compressFolderGuids = instance.CompressFolders
                                      .Select(x => UnityEditorUtility.GetAssetGUID(x))
                                      .ToArray();

            compressFolderView.SetContents(compressFolderGuids);

            //------ Sprite Folder ------

            spriteFolderView = new FolderRegisterScrollView("Sprite Folder", "TextureAssetTunerConfigInspector-SpriteFolder");

            spriteFolderView.RemoveChildrenFolder = true;

            spriteFolderView.OnUpdateContentsAsObservable()
            .Subscribe(x => SaveSpriteFolders(x.Select(y => y.asset).ToArray()))
            .AddTo(lifetimeDisposable.Disposable);

            var spriteFolderGuids = instance.SpriteFolders
                                    .Select(x => UnityEditorUtility.GetAssetGUID(x))
                                    .ToArray();

            spriteFolderView.SetContents(spriteFolderGuids);

            //------ Ignore Compress FolderName ------

            ignoreCompressFolderNameScrollView = new FolderNameRegisterScrollView();

            ignoreCompressFolderNameScrollView.OnUpdateContentsAsObservable()
            .Subscribe(x => SaveIgnoreCompressFolders(x))
            .AddTo(lifetimeDisposable.Disposable);

            ignoreCompressFolderNameScrollView.SetContents(instance.IgnoreCompressFolders);

            //------ Sprite Folder Name ------

            spriteFolderNameScrollView = new FolderNameRegisterScrollView();

            spriteFolderNameScrollView.OnUpdateContentsAsObservable()
            .Subscribe(x => SaveSpriteFolderNames(x))
            .AddTo(lifetimeDisposable.Disposable);

            spriteFolderNameScrollView.SetContents(instance.SpriteFolderNames);

            //------ Ignore Sprite FolderName ------

            ignoreSpriteFolderNameScrollView = new FolderNameRegisterScrollView();

            ignoreSpriteFolderNameScrollView.OnUpdateContentsAsObservable()
            .Subscribe(x => SaveIgnoreSpriteFolders(x))
            .AddTo(lifetimeDisposable.Disposable);

            ignoreSpriteFolderNameScrollView.SetContents(instance.IgnoreSpriteFolders);

            //------ Options ------

            changeSettingOnImport = TextureAssetTunerConfig.Prefs.changeSettingOnImport;
        }