Exemplo n.º 1
0
        public ColorPaletteCollection ToCollection()
        {
            ColorPaletteCollection result = ScriptableObject.CreateInstance <ColorPaletteCollection>();

            result.Name     = Name;
            result.Palettes = new List <ColorPalette>(Palettes);
            return(result);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
 }
Exemplo n.º 4
0
 public void ResetCollection()
 {
     ColorPaletteCollection = DefaultColorPaletteCollection;
     SetColorPalette(0);
 }
Exemplo n.º 5
0
 public JsonCollection FromCollection(ColorPaletteCollection collection)
 {
     Name     = collection.Name;
     Palettes = collection.Palettes.ToArray();
     return(this);
 }