Esempio n. 1
0
 public static bool ExportSceneResource(string customNamespace = null)
 {
     //IL_0015: Unknown result type (might be due to invalid IL or missing references)
     //IL_004e: Unknown result type (might be due to invalid IL or missing references)
     //IL_005f: Unknown result type (might be due to invalid IL or missing references)
     PipelineManager[] array = Object.FindObjectsOfType <PipelineManager>();
     if (array.Length > 0)
     {
         PipelineManager val = array[0];
         val.contentType = 1;
         if (string.IsNullOrEmpty(val.blueprintId))
         {
             val.AssignId();
         }
         EditorPrefs.SetString("lastBuiltAssetBundleBlueprintID", val.blueprintId);
         EditorUtility.SetDirty(array[0]);
         EditorSceneManager.MarkSceneDirty(val.get_gameObject().get_scene());
         EditorSceneManager.SaveScene(val.get_gameObject().get_scene());
     }
     if (CustomDLLMaker.CustomScriptsAvailable())
     {
         ExportCurrentSceneResourceWithPlugin(customNamespace);
         return(true);
     }
     CustomDLLMaker.ClearSavedPluginPrefs();
     AssetExporter.ExportCurrentSceneResource();
     return(false);
 }
Esempio n. 2
0
 private static void ExportSceneAndPrepareForUpload(string customNamespace = null)
 {
     try
     {
         if (shouldBuildUnityPackage)
         {
             AssetExporter.ExportCurrentSceneAsUnityPackage();
         }
         else
         {
             AssetExporter.CleanupUnityPackageExport();
         }
         if (ExportSceneResource(customNamespace))
         {
             if (!APIUser.get_CurrentUser().get_hasScriptingAccess() && CustomDLLMaker.CustomScriptsAvailable())
             {
                 CustomDLLMaker.ClearSavedPluginPrefs();
             }
             EditorAssemblies.AddOnAssemblyReloadCallback("CustomDLLMaker", "Cleanup");
             EditorAssemblies.AddOnAssemblyReloadCallback("VRC_SdkBuilder", "UploadLastExportedSceneBlueprint");
         }
         else
         {
             CustomDLLMaker.ClearSavedPluginPrefs();
             UploadLastExportedSceneBlueprint();
         }
     }
     catch (Exception ex)
     {
         AssetExporter.CleanupTmpFiles();
         EditorAssemblies.ClearAssemblyReloadCallbacks();
         throw ex;
         IL_0083 :;
     }
 }
Esempio n. 3
0
 private static void RecompileSceneScripts()
 {
     if (CustomDLLMaker.CustomScriptsAvailable())
     {
         string @string = EditorPrefs.GetString("lastExternalPluginPath");
         string text    = WWW.UnEscapeURL(EditorPrefs.GetString("lastVRCPath"));
         bool   flag    = false;
         if (string.IsNullOrEmpty(text) || (!string.IsNullOrEmpty(text) && !File.Exists(text)))
         {
             flag = true;
         }
         else if (!string.IsNullOrEmpty(@string) && !File.Exists(@string))
         {
             flag = true;
         }
         if (!flag)
         {
             CustomDLLMaker.BuildAndLoadPlugin(recompileCurrentPlugin: true);
         }
         else
         {
             EditorUtility.DisplayDialog("Could not recompile scripts", "Something went wrong. Please Test/Compile Full Scene (slow)", "OK");
         }
     }
 }
Esempio n. 4
0
    public static void RunLastExportedSceneResource()
    {
        string @string = EditorPrefs.GetString("lastExternalPluginPath");
        string string2 = EditorPrefs.GetString("lastVRCPath");
        bool   flag    = false;

        if (string.IsNullOrEmpty(string2) || (!string.IsNullOrEmpty(string2) && !File.Exists(string2)))
        {
            flag = true;
        }
        else if (CustomDLLMaker.CustomScriptsAvailable() && !string.IsNullOrEmpty(@string) && !File.Exists(@string))
        {
            flag = true;
        }
        if (!flag)
        {
            if (CustomDLLMaker.CustomScriptsAvailable())
            {
                RecompileSceneScripts();
            }
            AssetExporter.RunScene(string2, @string);
        }
        else
        {
            EditorUtility.DisplayDialog("Could not run VRChat scene", "Last built VRChat scene could not be found. Please Test/Compile Full Scene (slow).", "OK");
        }
    }
Esempio n. 5
0
 public static void UploadLastExportedSceneBlueprint()
 {
     if (VerifyCredentials())
     {
         string @string = EditorPrefs.GetString("lastExternalPluginPath");
         string text    = WWW.UnEscapeURL(EditorPrefs.GetString("lastVRCPath"));
         if (string.IsNullOrEmpty(text) || (!string.IsNullOrEmpty(text) && !File.Exists(text)) || (CustomDLLMaker.CustomScriptsAvailable() && !string.IsNullOrEmpty(@string) && !File.Exists(@string)))
         {
             EditorUtility.DisplayDialog("Could not run VRChat scene", "Last built VRChat scene could not be found. Please Test/Compile Full Scene (slow).", "OK");
         }
         else
         {
             int num = 0;
             if (ValidationHelpers.CheckIfAssetBundleFileTooLarge(1, text, ref num))
             {
                 EditorUtility.DisplayDialog("Could not publish VRChat scene", ValidationHelpers.GetAssetBundleOverSizeLimitMessage(1, num), "OK");
             }
             else
             {
                 EditorPrefs.SetString("currentBuildingAssetBundlePath", text);
                 if (APIUser.get_CurrentUser().get_hasScriptingAccess() && CustomDLLMaker.CustomScriptsAvailable())
                 {
                     EditorPrefs.SetString("externalPluginPath", @string);
                 }
                 else
                 {
                     CustomDLLMaker.ClearSavedPluginPrefs();
                 }
                 if (shouldBuildUnityPackage)
                 {
                     AssetExporter.ExportCurrentSceneAsUnityPackageIfNotExist();
                 }
                 else
                 {
                     AssetExporter.CleanupUnityPackageExport();
                 }
                 AssetExporter.LaunchSceneBlueprintUploader();
             }
         }
     }
 }