コード例 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="src"></param>
 /// <param name="prefabPath"></param>
 /// <param name="context"></param>
 static void ImportDelayed(string src, UnityPath prefabPath, ImporterContext context)
 {
     EditorApplication.delayCall += () =>
     {
         //
         // After textures imported(To ensure TextureImporter be accessible).
         //
         try
         {
             context.Load();
             context.SaveAsAsset(prefabPath);
             context.EditorDestroyRoot();
         }
         catch (UniGLTFNotSupportedException ex)
         {
             Debug.LogWarningFormat("{0}: {1}",
                                    src,
                                    ex.Message
                                    );
             context.EditorDestroyRootAndAssets();
         }
         catch (Exception ex)
         {
             Debug.LogErrorFormat("import error: {0}", src);
             Debug.LogErrorFormat("{0}", ex);
             context.EditorDestroyRootAndAssets();
         }
     };
 }