Пример #1
0
    public void OnChangeBrush()
    {
        var popup = Utility.InstantiatePrefab <Popup_ChangeBrush>(parentUI);

        if (popup.GetComponent <Popup_ChangeBrush>() != null)
        {
            popup.GetComponent <Popup_ChangeBrush>().Initialize((color, size) => {
                RuntimePalette.Get().OnChangeBrush(color, size);
            });
        }
    }
Пример #2
0
    public void OnChangeCanvas()
    {
        var popup = Utility.InstantiatePrefab <Popup_ChangeCanvas>(parentUI);

        if (popup.GetComponent <Popup_ChangeCanvas>() != null)
        {
            popup.GetComponent <Popup_ChangeCanvas>().Initialize((width, height) => {
                RuntimePalette.Get().OnChangeCanvasSize(width, height);
            });
        }
    }
Пример #3
0
    public void OnSavePalette()
    {
        //
        var popup = Utility.InstantiatePrefab <Popup_InputText>(parentUI);

        if (popup.GetComponent <Popup_InputText>() != null)
        {
            popup.GetComponent <Popup_InputText>().Initialize((name, bytes, width, height) => {
                //
                Dictionary <string, object> map = new Dictionary <string, object>();
                map.Add("name", name);
                map.Add("bytes", Encoding.Unicode.GetString(bytes));
                map.Add("width", width);
                map.Add("height", height);

                //
                Utility.ToJSONfile(name, map);
            }, RuntimePalette.Get().SaveAsBytes(), RuntimePalette.Get().rasterizedTex2D.width, RuntimePalette.Get().rasterizedTex2D.height);
        }
    }