Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog fileDialog = new OpenFileDialog();

            fileDialog.Filter = "(xml文件)|*.xml;";

            if (fileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            this.textBox1.Text = fileDialog.FileName;
            sb = new StringBuilder();

            PSDUI psdUI = (PSDUI)PSDImportUtility.DeserializeXml(fileDialog.FileName, typeof(PSDUI));

            LogLayer(psdUI.layers);

            string path = System.IO.Directory.GetCurrentDirectory() + "/OutPut/" +
                          fileDialog.SafeFileName.Substring(0, fileDialog.SafeFileName.Length - 4) + ".txt";

            if (File.Exists(path))
            {
                File.Delete(path);
            }

            StreamWriter sw = File.CreateText(path);

            sw.Write(sb.ToString());
            sw.Dispose();
            sw.Close();

            System.Diagnostics.Process.Start(path);
        }
Exemplo n.º 2
0
 private void DrawToolButtons()
 {
     if (GUILayout.Button("导出到UI"))
     {
         var atlasObj = (AtlasObject)target;
         PSDImportUtility.InitEnviroment(atlasObj.prefabObj, atlasObj.uiSize);
         PSDImportCtrl import = new PSDImportCtrl();
         import.Import(atlasObj.groups.ToArray(), atlasObj.uiSize);
     }
 }