Ejemplo n.º 1
0
 void DrawBodyMenu()
 {
     GUILayout.BeginHorizontal();
     {
         GUILayout.Label(_loadedPostmanFileName);
         if (GUILayout.Button("Import"))
         {
             string fileFullpath = EditorUtility.OpenFilePanel("CloudBread", "", "");
             if (!string.IsNullOrEmpty(fileFullpath))
             {
                 string json = CBToolEditor.ReadFile(fileFullpath);
                 try
                 {
                     Postman postman = JsonUtility.FromJson <Postman>(json);
                     _postman = postman;
                     _loadedPostmanFileFullPath = fileFullpath;
                     _loadedPostmanFileName     = System.IO.Path.GetFileName(_loadedPostmanFileFullPath);
                 }
                 catch (System.Exception e_)
                 {
                     Debug.LogError(e_);
                 }
             }
         }
     }
     GUILayout.EndHorizontal();
 }