public RunPlugin(SettingsPlugin settingsPlugin, ManagementPlugin managementPlugin, BuildPlugin build, GameDefinitionHub manager) { this.settingsPlugin = settingsPlugin; this.managementPlugin = managementPlugin; this.build = build; this.manager = manager; }
public static void Build(BuildTarget buildTarget, bool streamingAssetsGameDefinitionMode = false, bool autoRun = true) { BuildPlayerOptions buildPlayerOptions; try { buildPlayerOptions = BuildPlayerWindow.DefaultBuildMethods.GetBuildPlayerOptions(new BuildPlayerOptions() { target = buildTarget, targetGroup = BuildPipeline.GetBuildTargetGroup(buildTarget) }); } catch (BuildPlayerWindow.BuildMethodException e) { Debug.Log("BuildMethodException caught: " + e); return; } buildPlayerOptions.target = buildTarget; var settingsPlugin = new SettingsPlugin(); settingsPlugin.Update(); var manifestPath = settingsPlugin.buildSettings.GetAssetBundleManifestPath(buildTarget); if (!ValidateAssetBundleManifestFileExists(manifestPath)) { return; } buildPlayerOptions.assetBundleManifestPath = manifestPath; if (autoRun) { buildPlayerOptions.options |= BuildOptions.AutoRunPlayer; } var oldIntegrationMode = settingsPlugin.settings.ServerMode; if (streamingAssetsGameDefinitionMode) { Debug.Log($"Configuring {nameof(ServerMode)}.{nameof(ServerMode.Simulation)}"); settingsPlugin.settings.ServerMode = ServerMode.Simulation; EditorUtility.SetDirty(settingsPlugin.settings); } try { var report = BuildPipeline.BuildPlayer(buildPlayerOptions); if (report.summary.result == BuildResult.Cancelled && autoRun && EditorUtility.DisplayDialog("Build Cancelled", "Would you like to re-run the build without autoRun?", "Yes", "No")) { buildPlayerOptions.options |= BuildOptions.AutoRunPlayer; BuildPipeline.BuildPlayer(buildPlayerOptions); } } finally { settingsPlugin.settings.ServerMode = oldIntegrationMode; EditorUtility.SetDirty(settingsPlugin.settings); } }
protected virtual IHubPlugin[] CreatePlugins() { var settings = new SettingsPlugin(); var directory = new DirectoryPlugin(settings); var management = new ManagementPlugin(settings, this); return(new IHubPlugin[] { new TitlePlugin(fullTitle), settings, directory, management, new EditorPlugin <TGameDefinition>(settings, management, this), new CustomPlatformSettingsPlugin(management, this), new BundlesPlugin(), new BuildPlugin(settings, management, this) }); }
public SimulationPlugin(ManagementPlugin managementPlugin, SettingsPlugin settingsPlugin) { this.managementPlugin = managementPlugin; this.settingsPlugin = settingsPlugin; }
public void InstallTestEnv() { DebugText.text = SettingsPlugin.InstallEnvironment(); Debug.Log(DebugText.text); }