void OnEnable()
        {
            _target          = target as Colormap;
            dirty            = new ColormapDirtyCheck(_target);
            autoApplyChanges = true;

            //usedColors = serializedObject.FindProperty("usedColors");

            EditorApplication.update += OnEditorUpdate;

            if (!_target.initialized)
            {
                Debug.Log("Initializing colormap '" + _target.name + "'");

                _target.initialized = true;
                UpdateColormap();
            }
        }
Example #2
0
        void OnEnable()
        {
            _target          = target as Colormap;
            dirty            = new ColormapDirtyCheck(_target);
            autoApplyChanges = true;

            //usedColors = serializedObject.FindProperty("usedColors");

            EditorApplication.update += OnEditorUpdate;

            if (!_target.initialized)
            {
                Debug.Log("Initializing colormap '" + _target.name + "'");

                _target.initialized = true;
                StartUpdatingColormap();
            }

            presetMenu = new GenericMenu();
            DirectoryInfo dirInfo = new DirectoryInfo(Application.dataPath + "/Retro Pixel Pro/Colormap Presets");

            FileUtils.AddFilesInDirectory(dirInfo, presetMenu, "", PresetMenuCallback);
        }