BuildPlayer() public static method

Builds a player.

public static BuildPlayer ( BuildPlayerOptions buildPlayerOptions ) : string
buildPlayerOptions BuildPlayerOptions Provide various options to control the behavior of BuildPipeline.BuildPlayer.
return string
Exemplo n.º 1
0
        public static void MakeWin32TestingBuild()
        {
            Setup();
            SetScriptingBackend(ScriptingImplementation.Mono2x, BuildTarget.StandaloneWindows, BuildTargetGroup.Standalone);
#if UNITY_2018_1_OR_NEWER
            PlayerSettings.fullScreenMode = FullScreenMode.Windowed;
#else
            PlayerSettings.defaultIsFullScreen = false;
#endif
            PlayerSettings.defaultScreenHeight = 768;
            PlayerSettings.defaultScreenWidth  = 1024;
            PlayerSettings.runInBackground     = true;
#if !UNITY_2019_2_OR_NEWER
#pragma warning disable 0618
            PlayerSettings.displayResolutionDialog = ResolutionDialogSetting.Disabled;
#pragma warning restore 0618
#endif
            PlayerSettings.resizableWindow = true;
            string win32Path = Path.Combine(GetBuildPath(), "Win32test.exe");
            MkDir(GetBuildPath());
            BuildPipeline.BuildPlayer(TestScenes, win32Path, BuildTarget.StandaloneWindows, BuildOptions.None);
            if (!File.Exists(win32Path))
            {
                throw new PlayFabException(PlayFabExceptionCode.BuildError, "Target file did not build: " + win32Path);
            }
        }
Exemplo n.º 2
0
        public static void MakeAndroidBuild()
        {
            Setup();
            SetScriptingBackend(ScriptingImplementation.Mono2x, BuildTarget.Android, BuildTargetGroup.Android); // Ideal setting for Android
            SetIdentifier(BuildTargetGroup.Android, TestPackageName);
            var androidPackage = Path.Combine(GetBuildPath(), "PlayFabAndroid.apk");

            MkDir(GetBuildPath());
            BuildPipeline.BuildPlayer(TestScenes, androidPackage, BuildTarget.Android, BuildOptions.None);
            if (!File.Exists(androidPackage))
            {
                throw new PlayFabException(PlayFabExceptionCode.BuildError, "Target file did not build: " + androidPackage);
            }
        }
Exemplo n.º 3
0
        public static void MakeXboxOneBuild()
        {
            Setup();
            SetScriptingBackend(ScriptingImplementation.IL2CPP, BuildTarget.XboxOne, BuildTargetGroup.XboxOne);
            //SetScriptingBackend( ScriptingImplementation.Mono2x, BuildTarget.XboxOne, BuildTargetGroup.XboxOne );
            SetIdentifier(BuildTargetGroup.XboxOne, TestPackageName);
            var xboxOnePath = Path.Combine(GetBuildPath(), "PlayFabXboxOne");

            MkDir(GetBuildPath());
            MkDir(xboxOnePath);
            BuildPipeline.BuildPlayer(TestScenes, xboxOnePath, BuildTarget.XboxOne, BuildOptions.None);
            if (Directory.GetFileSystemEntries(xboxOnePath).Length == 0)
            {
                throw new PlayFabException(PlayFabExceptionCode.BuildError, "Target directory is empty: " + xboxOnePath + ", " + string.Join(",", Directory.GetFiles(xboxOnePath)));
            }
        }
Exemplo n.º 4
0
        public static void MakeSwitchBuild()
        {
            Setup();
            SetScriptingBackend(ScriptingImplementation.IL2CPP, BuildTarget.Switch, BuildTargetGroup.Switch);
            SetIdentifier(BuildTargetGroup.Switch, "PlayFabSwitchTest");
            PlayerSettings.SplashScreen.show            = false;
            EditorUserBuildSettings.switchCreateRomFile = true;

            var switchPackage = Path.Combine(GetBuildPath(), "PlayFabSwitch.nsp");

            MkDir(GetBuildPath());
            BuildPipeline.BuildPlayer(TestScenes, switchPackage, BuildTarget.Switch, BuildOptions.None);
            if (!File.Exists(switchPackage))
            {
                throw new PlayFabException(PlayFabExceptionCode.BuildError, "Target file did not build: " + switchPackage);
            }
        }
Exemplo n.º 5
0
        public static void MakeOsxBuild()
        {
            Setup();
            //SetScriptingBackend(ScriptingImplementation.IL2CPP, OsxBuildTarget, BuildTargetGroup.Standalone);  // IL2CPP can only be built on Mac.
            SetScriptingBackend(ScriptingImplementation.Mono2x, OsxBuildTarget, BuildTargetGroup.Standalone);
            SetIdentifier(AppleBuildTargetGroup, TestPackageName);
            var osxAppName = "PlayFabOSX";
            var osxPath    = Path.Combine(GetBuildPath(), osxAppName);

            MkDir(GetBuildPath());
            MkDir(osxPath);
            BuildPipeline.BuildPlayer(TestScenes, Path.Combine(osxPath, osxAppName), OsxBuildTarget, BuildOptions.None);
            if (Directory.GetFileSystemEntries(osxPath).Length == 0)
            {
                throw new PlayFabException(PlayFabExceptionCode.BuildError, "Target directory is empty: " + osxPath + ", " + string.Join(",", Directory.GetFiles(osxPath)));
            }
        }
Exemplo n.º 6
0
        public static void MakeIPhoneBuild()
        {
            Setup();
#if UNITY_2018_1_OR_NEWER
            SetScriptingBackend(ScriptingImplementation.IL2CPP, AppleBuildTarget, AppleBuildTargetGroup); // Ideally we should be testing both at some point, but ...
#else
            SetScriptingBackend(ScriptingImplementation.Mono2x, AppleBuildTarget, AppleBuildTargetGroup); // Mono2x is traditionally the one with issues, and it's a lot faster to build/test
#endif
            SetIdentifier(AppleBuildTargetGroup, TestPackageName);
            var iosPath = Path.Combine(GetBuildPath(), "PlayFabIOS");
            MkDir(GetBuildPath());
            MkDir(iosPath);
            BuildPipeline.BuildPlayer(TestScenes, iosPath, AppleBuildTarget, BuildOptions.None);
            if (Directory.GetFiles(iosPath).Length == 0)
            {
                throw new PlayFabException(PlayFabExceptionCode.BuildError, "Target directory is empty: " + iosPath + ", " + string.Join(",", Directory.GetFiles(iosPath)));
            }
        }
Exemplo n.º 7
0
        public static void MakePS4Build()
        {
            Setup();
            SetScriptingBackend(ScriptingImplementation.IL2CPP, BuildTarget.PS4, BuildTargetGroup.PS4);
            SetIdentifier(BuildTargetGroup.PS4, TestPackageName);
#if UNITY_5_6_OR_NEWER
            PlayerSettings.SplashScreen.show = false;
#endif
            PlayerSettings.PS4.parentalLevel = 0;
            var ps4Path = Path.Combine(GetBuildPath(), "PlayFabPS4");
            MkDir(GetBuildPath());
            MkDir(ps4Path);
            BuildPipeline.BuildPlayer(TestScenes, ps4Path, BuildTarget.PS4, BuildOptions.None);
            if (Directory.GetFiles(ps4Path).Length == 0)
            {
                throw new PlayFabException(PlayFabExceptionCode.BuildError, "Target directory is empty: " + ps4Path + ", " + string.Join(",", Directory.GetFiles(ps4Path)));
            }
        }
Exemplo n.º 8
0
        public static void MakePS4Build()
        {
            Setup();
            PlayerSettings.PS4.enableApplicationExit = true; // Only suitable for dev/test applications
            SetScriptingBackend(ScriptingImplementation.IL2CPP, BuildTarget.PS4, BuildTargetGroup.PS4);
            SetIdentifier(BuildTargetGroup.PS4, TestPackageName);
#if UNITY_5_6_OR_NEWER
            PlayerSettings.SplashScreen.show = false;
#endif
            PlayerSettings.PS4.parentalLevel = 0;
            var ps4Path = Path.Combine(GetBuildPath(), "PlayFabPS4");
            MkDir(GetBuildPath());
            MkDir(ps4Path);
            BuildPipeline.BuildPlayer(TestScenes, ps4Path, BuildTarget.PS4, BuildOptions.Development); // Development build is required for final test-result submission (bug)
            if (Directory.GetFiles(ps4Path).Length == 0)
            {
                throw new PlayFabException(PlayFabExceptionCode.BuildError, "Target directory is empty: " + ps4Path + ", " + string.Join(",", Directory.GetFiles(ps4Path)));
            }
        }
Exemplo n.º 9
0
        public static void MakeWp8Build()
        {
            Setup();
#if UNITY_2017_1_OR_NEWER
            EditorUserBuildSettings.wsaBuildAndRunDeployTarget = WSABuildAndRunDeployTarget.WindowsPhone;
            EditorUserBuildSettings.wsaSubtarget = WSASubtarget.AnyDevice;
#if !UNITY_2019_1_OR_NEWER
            EditorUserBuildSettings.wsaGenerateReferenceProjects = true;
#endif
            PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.InternetClient, true);
#elif UNITY_5_2 || UNITY_5_3_OR_NEWER
            EditorUserBuildSettings.wsaSDK = WSASDK.UniversalSDK81;
#endif
            var wp8Path = Path.Combine(GetBuildPath(), "PlayFabWP8");
            MkDir(GetBuildPath());
            MkDir(wp8Path);
            BuildPipeline.BuildPlayer(TestScenes, wp8Path, WsaBuildTarget, BuildOptions.None);
            if (Directory.GetFiles(wp8Path).Length == 0)
            {
                throw new PlayFabException(PlayFabExceptionCode.BuildError, "Target directory is empty: " + wp8Path + ", " + string.Join(",", Directory.GetFiles(wp8Path)));
            }
        }
Exemplo n.º 10
0
 BuildPlayer(BuildPlayerSettings settings)
 {
     return(UBuildPipeline.BuildPlayer(settings.Levels, settings.OutputPath, settings.Target, settings.Options));
 }