Пример #1
0
            private void OnGUI()
            {
                EGL.LabelField("Use Settings");
                settings = EGL.ObjectField(settings, typeof(ImportSettings), false) as ImportSettings;

                EGL.Space();

                if (settings && CenteredButton("OK"))
                {
                    var reference = new MetaSpriteImportData
                    {
                        metaSpriteSettingsGuid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(settings))
                    };
                    foreach (var path in assetPaths)
                    {
                        var import = AssetImporter.GetAtPath(path);
                        import.userData = JsonUtility.ToJson(reference);
                        import.SaveAndReimport();
                    }

                    finishedAction(settings);
                    this.Close();
                }

                if (CenteredButton("Cancel"))
                {
                    this.Close();
                }
            }
Пример #2
0
 private void OnGUI()
 {
     m_Editor.OnInspectorGUI();
     if (CenteredButton("Close"))
     {
         var guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(m_Reference.ImporterSettings));
         var data = new MetaSpriteImportData
         {
             metaSpriteSettingsGuid = guid
         };
         m_Paths.ForEach(x =>
         {
             var import      = AssetImporter.GetAtPath(x);
             import.userData = JsonUtility.ToJson(data);
             import.SaveAndReimport();
         });
         this.Close();
     }
 }