예제 #1
0
        void OnGUI()
        {
            // If this is the first iteration since the window is opened, do the needed initializzations
            if (firstCycle)
            {
                Start();
                firstCycle = false;
            }

            packer.DrawGUI();

            if (GUILayout.Button("Save Packed Texture"))
            {
                string path = TSFunctions.GetSelectedPathOrFallback();
                path = EditorUtility.SaveFilePanel("Save Texture", path, "Packed", "png");
                if (path.Length != 0)
                {
                    packer.PackTexture(path);
                }
            }
        }
예제 #2
0
        void OnGUI()
        {
            // If this is the first iteration since the window is opened, do the needed initializzations
            if (firstCycle)
            {
                Start();
                firstCycle = false;
            }

            if (gradientEditor.DrawGUI())
            {
                Repaint();
            }

            if (GUILayout.Button("Save Gradient"))
            {
                string path = TSFunctions.GetSelectedPathOrFallback();
                path = EditorUtility.SaveFilePanel("Save Ramp", path, "gradient", "png");
                if (path.Length != 0)
                {
                    gradientEditor.SaveGradient(path);
                }
            }
        }
예제 #3
0
 private void Start()
 {
     packer = new TexturePacker(TexturePacker.Resolution.M_512x512, new string[] { "Texture 1 (R)", "Texture 2 (G)", "Texture 3 (B)", "Texture 4 (A)" }, TSFunctions.GetSelectedPathOrFallback() + "Packed.png");
     packer.drawInternalConfirmButton = false;
 }