예제 #1
0
    void Start()
    {
        _colors = ColorPresetManager.Get(picker.Setup.PresetColorsId);

        if (_colors.Colors.Count < picker.Setup.DefaultPresetColors.Length)
        {
            _colors.UpdateList(picker.Setup.DefaultPresetColors);
        }

        _colors.OnColorsUpdated += OnColorsUpdate;
        OnColorsUpdate(_colors.Colors);
    }
예제 #2
0
    public static void Save()
    {
        JSONObject obj    = new JSONObject();
        JSONArray  colors = new JSONArray();

        foreach (Color color in ColorPresetManager.Get().Colors)
        {
            colors.Add(ColourManager.ColourToInt(color));
        }
        obj.Add("colors", colors);
        using (StreamWriter writer = new StreamWriter(Application.persistentDataPath + "/ChromaColors.json", false))
            writer.Write(obj.ToString());
        Debug.Log("Chroma Colors saved!");
    }