Exemple #1
0
        void PresetMenuCallback(object obj)
        {
            string         presetName = obj as string;
            ColormapPreset preset     = FileUtils.LoadColormapPreset(presetName);

            //Debug.Log("preset: " + preset);
            _target.ApplyPreset(preset);
            dirty.forceDirty = true;
        }
Exemple #2
0
        static void CreateNewColormap()
        {
            string path = EditorUtility.SaveFilePanelInProject(MENU_ITEM_NAME, "New Colormap", "asset", MENU_ITEM_NAME);

            if (string.IsNullOrEmpty(path))
            {
                return;
            }

            Colormap       colormap = CreateInstance <Colormap>();
            ColormapPreset preset   = FileUtils.LoadColormapPreset("Classics/Breadbox 1982.asset");

            colormap.ApplyPreset(preset);

            AssetDatabase.CreateAsset(colormap, path);
            AssetDatabase.SaveAssets();
        }
        static void CreateNewColormap()
        {
            string path = EditorUtility.SaveFilePanel(MENU_ITEM_NAME, "Assets/", "New Colormap.asset", "asset");

            if (string.IsNullOrEmpty(path))
            {
                return;
            }

            path = FileUtil.GetProjectRelativePath(path);

            Colormap colormap = CreateInstance <Colormap>();

            ColormapPreset preset = FileUtils.LoadColormapPreset("Classic6.asset");

            //Debug.Log("preset: " + preset);
            colormap.ApplyPreset(preset);

            AssetDatabase.CreateAsset(colormap, path);
            AssetDatabase.SaveAssets();
        }