private static void CheckForAssimpAsset(string str)
        {
            if (!TriLibCheckPlugins.PluginsLoaded)
            {
                return;
            }
            var extension = Path.GetExtension(str);

            if (extension == null)
            {
                return;
            }
            foreach (var unityExtension in UnityExtensions)
            {
                if (unityExtension == extension.ToLower())
                {
                    return;
                }
            }
            if (AssimpInterop.ai_IsExtensionSupported(extension))
            {
                TriLibAssetImporter.Import(str);
#if TRILIB_OUTPUT_MESSAGES
                Debug.LogFormat("Asset imported: {0}", str);
#endif
            }
        }
Ejemplo n.º 2
0
 static TriLibCheckPlugins()
 {
     try
     {
         AssimpInterop.ai_IsExtensionSupported(".3ds");
         PluginsLoaded = true;
     }
     catch (Exception exception)
     {
         if (exception is DllNotFoundException)
         {
             if (EditorUtility.DisplayDialog("TriLib plugins not found", "TriLib was unable to find the native plugins.\n\nIf you just imported the package, you will have to restart Unity editor.\n\nIf you click \"Ask to save changes and restart\", you will be prompted to save your changes (if there is any) then Unity editor will restart.\n\nOtherwise, you will have to save your changes and restart Unity editor manually.", "Ask to save changes and restart", "I will do it manually"))
             {
                 EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo();
                 var projectPath = Directory.GetParent(Application.dataPath);
                 EditorApplication.OpenProject(projectPath.FullName);
             }
         }
     }
 }