Exemple #1
0
        public ColorPaletteCollection ToCollection()
        {
            ColorPaletteCollection result = ScriptableObject.CreateInstance <ColorPaletteCollection>();

            result.Name     = Name;
            result.Palettes = new List <ColorPalette>(Palettes);
            return(result);
        }
Exemple #2
0
        public void LoadCollection()
        {
            Cursor.visible = true;
            var path = EditorUtility.OpenFilePanel("Load color palette collection ...", "", "json");

            Cursor.visible = false;
            if (path.Length > 0)
            {
                string json = File.ReadAllText(path);
                ColorPaletteCollection asset = JsonUtility.FromJson <JsonCollection>(json).ToCollection();

                ColorPaletteCollection = asset;
                AssetDatabase.CreateAsset(asset, "Assets/ColorPalettes/" + asset.Name + ".asset");
                AssetDatabase.SaveAssets();
            }
            SetColorPalette(0);
        }
Exemple #3
0
 private void Awake()
 {
     if (Instance != null)
     {
         Destroy(gameObject);
         return;
     }
     Instance       = this;
     Cursor.visible = false;
     DontDestroyOnLoad(gameObject);
     DefaultSVP.TryGet(out _bloom);
     DefaultSVP.TryGet(out _lensDistortion);
     _camera = Camera.main;
     SceneManager.sceneLoaded += OnSceneLoaded;
     CurrentOptions            = new Options(DefaultOptions);
     SetColorPalette(CurrentOptions.colorPalette);
     ColorPaletteCollection = DefaultColorPaletteCollection;
 }
Exemple #4
0
 public void ResetCollection()
 {
     ColorPaletteCollection = DefaultColorPaletteCollection;
     SetColorPalette(0);
 }
Exemple #5
0
 public JsonCollection FromCollection(ColorPaletteCollection collection)
 {
     Name     = collection.Name;
     Palettes = collection.Palettes.ToArray();
     return(this);
 }