inicial
This commit is contained in:
+104
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using UnityEditor.Build;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEditor.TestTools.TestRunner
|
||||
{
|
||||
internal class AndroidPlatformSetup : IPlatformSetup
|
||||
{
|
||||
private string m_oldApplicationIdentifier;
|
||||
private string m_oldDeviceSocketAddress;
|
||||
[SerializeField]
|
||||
private bool m_Stripping;
|
||||
|
||||
private bool RequiresLegacyConnectionMechanism =>
|
||||
#if !UNITY_2021_2_OR_NEWER
|
||||
true;
|
||||
#else
|
||||
false;
|
||||
#endif
|
||||
|
||||
private void PerformLegacySetup()
|
||||
{
|
||||
m_oldDeviceSocketAddress = EditorUserBuildSettings.androidDeviceSocketAddress;
|
||||
|
||||
var androidDeviceConnection = Environment.GetEnvironmentVariable("ANDROID_DEVICE_CONNECTION");
|
||||
if (androidDeviceConnection != null)
|
||||
{
|
||||
EditorUserBuildSettings.androidDeviceSocketAddress = androidDeviceConnection;
|
||||
}
|
||||
}
|
||||
|
||||
private void PerformLegacyCleanup()
|
||||
{
|
||||
EditorUserBuildSettings.androidDeviceSocketAddress = m_oldDeviceSocketAddress;
|
||||
}
|
||||
|
||||
private void PerformLegacyPostSuccessfulLaunchAction()
|
||||
{
|
||||
var connectionResult = -1;
|
||||
var maxTryCount = 30;
|
||||
var tryCount = maxTryCount;
|
||||
while (tryCount-- > 0 && connectionResult == -1)
|
||||
{
|
||||
connectionResult = EditorConnectionInternal.ConnectPlayerProxy(IPAddress.Loopback.ToString(), 34999);
|
||||
if (EditorUtility.DisplayCancelableProgressBar("Editor Connection", "Connecting to the player",
|
||||
1 - ((float)tryCount / maxTryCount)))
|
||||
{
|
||||
EditorUtility.ClearProgressBar();
|
||||
throw new TestLaunchFailedException();
|
||||
}
|
||||
}
|
||||
EditorUtility.ClearProgressBar();
|
||||
if (connectionResult == -1)
|
||||
throw new TestLaunchFailedException(
|
||||
"Timed out trying to connect to the player. Player failed to launch or crashed soon after launching");
|
||||
}
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
#if UNITY_2021_2_OR_NEWER
|
||||
m_oldApplicationIdentifier = PlayerSettings.GetApplicationIdentifier(NamedBuildTarget.Android);
|
||||
PlayerSettings.SetApplicationIdentifier(NamedBuildTarget.Android, "com.UnityTestRunner.UnityTestRunner");
|
||||
#else
|
||||
m_oldApplicationIdentifier = PlayerSettings.GetApplicationIdentifier(BuildTargetGroup.Android);
|
||||
PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, "com.UnityTestRunner.UnityTestRunner");
|
||||
#endif
|
||||
|
||||
|
||||
if (RequiresLegacyConnectionMechanism)
|
||||
PerformLegacySetup();
|
||||
|
||||
EditorUserBuildSettings.waitForPlayerConnection = true;
|
||||
m_Stripping = PlayerSettings.stripEngineCode;
|
||||
PlayerSettings.stripEngineCode = false;
|
||||
}
|
||||
|
||||
public void PostBuildAction()
|
||||
{
|
||||
PlayerSettings.stripEngineCode = m_Stripping;
|
||||
}
|
||||
|
||||
public void PostSuccessfulBuildAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void PostSuccessfulLaunchAction()
|
||||
{
|
||||
if (RequiresLegacyConnectionMechanism)
|
||||
PerformLegacyPostSuccessfulLaunchAction();
|
||||
}
|
||||
|
||||
public void CleanUp()
|
||||
{
|
||||
if (RequiresLegacyConnectionMechanism)
|
||||
PerformLegacyCleanup();
|
||||
#if UNITY_2021_2_OR_NEWER
|
||||
PlayerSettings.SetApplicationIdentifier(NamedBuildTarget.Android, m_oldApplicationIdentifier);
|
||||
#else
|
||||
PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, m_oldApplicationIdentifier);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 961642509dec50b44a293d26240140ec
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEditor.TestTools.TestRunner
|
||||
{
|
||||
[Serializable]
|
||||
internal class ApplePlatformSetup : IPlatformSetup
|
||||
{
|
||||
[SerializeField]
|
||||
private bool m_Stripping;
|
||||
|
||||
private bool m_RunOnSimulator;
|
||||
private List<int> m_XcodesOpenBeforeTests;
|
||||
private List<int> m_XcodesToCloseAfterTests;
|
||||
private List<int> m_SimulatorsOpenBeforeTests;
|
||||
|
||||
public ApplePlatformSetup(BuildTarget buildTarget)
|
||||
{
|
||||
}
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
// Camera and fonts are stripped out and app crashes on iOS when test runner is trying to add a scene with... camera and text
|
||||
m_Stripping = PlayerSettings.stripEngineCode;
|
||||
PlayerSettings.stripEngineCode = false;
|
||||
|
||||
m_RunOnSimulator = EditorUserBuildSettings.activeBuildTarget == BuildTarget.iOS
|
||||
? PlayerSettings.iOS.sdkVersion == iOSSdkVersion.SimulatorSDK
|
||||
: PlayerSettings.tvOS.sdkVersion == tvOSSdkVersion.Simulator;
|
||||
|
||||
// Gather IDs of Xcodes that were already open before building and running the tests
|
||||
if (Application.isEditor && Application.isBatchMode)
|
||||
{
|
||||
m_XcodesOpenBeforeTests = new List<int>();
|
||||
foreach (var xcode in Process.GetProcessesByName("Xcode"))
|
||||
{
|
||||
m_XcodesOpenBeforeTests.Add(xcode.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void PostBuildAction()
|
||||
{
|
||||
// Restoring player setting as early as possible
|
||||
PlayerSettings.stripEngineCode = m_Stripping;
|
||||
|
||||
// Gather IDs of Xcodes that were opened while building the tests
|
||||
if (Application.isEditor && Application.isBatchMode)
|
||||
{
|
||||
m_XcodesToCloseAfterTests = new List<int>();
|
||||
foreach (var xcode in Process.GetProcessesByName("Xcode"))
|
||||
{
|
||||
if (!m_XcodesOpenBeforeTests?.Contains(xcode.Id) ?? false)
|
||||
m_XcodesToCloseAfterTests.Add(xcode.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void PostSuccessfulBuildAction()
|
||||
{
|
||||
// Gather IDs of Simulator processes that were already open before successfully building the tests
|
||||
if (Application.isEditor && Application.isBatchMode && m_RunOnSimulator)
|
||||
{
|
||||
m_SimulatorsOpenBeforeTests = new List<int>();
|
||||
foreach (var simulator in Process.GetProcessesByName("Simulator"))
|
||||
{
|
||||
m_SimulatorsOpenBeforeTests.Add(simulator.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void PostSuccessfulLaunchAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void CleanUp()
|
||||
{
|
||||
// Close Xcode that was opened while building the tests (batchmode only)
|
||||
// should be only one such Xcode, otherwise skip to avoid closing unrelated Xcodes
|
||||
if (Application.isEditor && Application.isBatchMode &&
|
||||
m_XcodesToCloseAfterTests != null && m_XcodesToCloseAfterTests.Count == 1)
|
||||
{
|
||||
var xcodeToClose = Process.GetProcessById(m_XcodesToCloseAfterTests[0]);
|
||||
|
||||
if (xcodeToClose.ProcessName == "Xcode")
|
||||
{
|
||||
xcodeToClose.CloseMainWindow();
|
||||
xcodeToClose.Close();
|
||||
}
|
||||
}
|
||||
|
||||
// Close all Simulator processes that were opened after successfully building the tests (batchmode only)
|
||||
if (Application.isEditor && Application.isBatchMode && m_RunOnSimulator)
|
||||
{
|
||||
foreach (var simulator in Process.GetProcessesByName("Simulator"))
|
||||
{
|
||||
if (!m_SimulatorsOpenBeforeTests?.Contains(simulator.Id) ?? false)
|
||||
{
|
||||
simulator.CloseMainWindow();
|
||||
simulator.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6c189a159d3bde4c964cee562e508ea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEditor.TestTools.TestRunner
|
||||
{
|
||||
internal interface IPlatformSetup
|
||||
{
|
||||
void Setup();
|
||||
void PostBuildAction();
|
||||
void PostSuccessfulBuildAction();
|
||||
void PostSuccessfulLaunchAction();
|
||||
void CleanUp();
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9d614808f9add8a4f8e4860db2c7af0d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEditor.TestTools.TestRunner
|
||||
{
|
||||
internal class LuminPlatformSetup : IPlatformSetup
|
||||
{
|
||||
private const string kDeviceAddress = "127.0.0.1";
|
||||
private const int kDevicePort = 55000;
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
}
|
||||
|
||||
public void PostBuildAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void PostSuccessfulBuildAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void PostSuccessfulLaunchAction()
|
||||
{
|
||||
var connectionResult = -1;
|
||||
var maxTryCount = 100;
|
||||
var tryCount = maxTryCount;
|
||||
while (tryCount-- > 0 && connectionResult == -1)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
connectionResult = EditorConnectionInternal.ConnectPlayerProxy(kDeviceAddress, kDevicePort);
|
||||
if (EditorUtility.DisplayCancelableProgressBar("Editor Connection", "Connecting to the player",
|
||||
1 - ((float)tryCount / maxTryCount)))
|
||||
{
|
||||
EditorUtility.ClearProgressBar();
|
||||
throw new TestLaunchFailedException();
|
||||
}
|
||||
}
|
||||
EditorUtility.ClearProgressBar();
|
||||
if (connectionResult == -1)
|
||||
throw new TestLaunchFailedException(
|
||||
"Timed out trying to connect to the player. Player failed to launch or crashed soon after launching");
|
||||
}
|
||||
|
||||
public void CleanUp()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c38ae0585d6a55042a2d678330689685
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEditor.TestTools.TestRunner
|
||||
{
|
||||
[Serializable]
|
||||
internal class PlatformSpecificSetup
|
||||
{
|
||||
[SerializeField]
|
||||
private ApplePlatformSetup m_AppleiOSPlatformSetup = new ApplePlatformSetup(BuildTarget.iOS);
|
||||
[SerializeField]
|
||||
private ApplePlatformSetup m_AppleTvOSPlatformSetup = new ApplePlatformSetup(BuildTarget.tvOS);
|
||||
#if !UNITY_2021_1_OR_NEWER
|
||||
[SerializeField]
|
||||
private XboxOnePlatformSetup m_XboxOnePlatformSetup = new XboxOnePlatformSetup();
|
||||
#endif
|
||||
[SerializeField]
|
||||
private AndroidPlatformSetup m_AndroidPlatformSetup = new AndroidPlatformSetup();
|
||||
[SerializeField]
|
||||
private SwitchPlatformSetup m_SwitchPlatformSetup = new SwitchPlatformSetup();
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
[SerializeField]
|
||||
private StadiaPlatformSetup m_StadiaPlatformSetup = new StadiaPlatformSetup();
|
||||
#endif
|
||||
[SerializeField]
|
||||
private UwpPlatformSetup m_UwpPlatformSetup = new UwpPlatformSetup();
|
||||
|
||||
[SerializeField]
|
||||
private LuminPlatformSetup m_LuminPlatformSetup = new LuminPlatformSetup();
|
||||
|
||||
|
||||
private IDictionary<BuildTarget, IPlatformSetup> m_SetupTypes;
|
||||
|
||||
[SerializeField]
|
||||
private BuildTarget m_Target;
|
||||
|
||||
public PlatformSpecificSetup()
|
||||
{
|
||||
}
|
||||
|
||||
public PlatformSpecificSetup(BuildTarget target)
|
||||
{
|
||||
m_Target = target;
|
||||
}
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
var dictionary = GetSetup();
|
||||
|
||||
if (!dictionary.ContainsKey(m_Target))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
dictionary[m_Target].Setup();
|
||||
}
|
||||
|
||||
public void PostBuildAction()
|
||||
{
|
||||
var dictionary = GetSetup();
|
||||
|
||||
if (!dictionary.ContainsKey(m_Target))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
dictionary[m_Target].PostBuildAction();
|
||||
}
|
||||
|
||||
public void PostSuccessfulBuildAction()
|
||||
{
|
||||
var dictionary = GetSetup();
|
||||
|
||||
if (!dictionary.ContainsKey(m_Target))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
dictionary[m_Target].PostSuccessfulBuildAction();
|
||||
}
|
||||
|
||||
public void PostSuccessfulLaunchAction()
|
||||
{
|
||||
var dictionary = GetSetup();
|
||||
|
||||
if (!dictionary.ContainsKey(m_Target))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
dictionary[m_Target].PostSuccessfulLaunchAction();
|
||||
}
|
||||
|
||||
public void CleanUp()
|
||||
{
|
||||
var dictionary = GetSetup();
|
||||
|
||||
if (!dictionary.ContainsKey(m_Target))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
dictionary[m_Target].CleanUp();
|
||||
}
|
||||
|
||||
private IDictionary<BuildTarget, IPlatformSetup> GetSetup()
|
||||
{
|
||||
m_SetupTypes = new Dictionary<BuildTarget, IPlatformSetup>
|
||||
{
|
||||
{BuildTarget.iOS, m_AppleiOSPlatformSetup},
|
||||
{BuildTarget.tvOS, m_AppleTvOSPlatformSetup},
|
||||
#if !UNITY_2021_1_OR_NEWER
|
||||
{BuildTarget.XboxOne, m_XboxOnePlatformSetup},
|
||||
#endif
|
||||
{BuildTarget.Android, m_AndroidPlatformSetup},
|
||||
{BuildTarget.WSAPlayer, m_UwpPlatformSetup},
|
||||
#if !UNITY_2022_2_OR_NEWER
|
||||
{BuildTarget.Lumin, m_LuminPlatformSetup},
|
||||
#endif
|
||||
#if UNITY_2019_3_OR_NEWER && !UNITY_2023_1_OR_NEWER
|
||||
{BuildTarget.Stadia, m_StadiaPlatformSetup},
|
||||
#endif
|
||||
{BuildTarget.Switch, m_SwitchPlatformSetup}
|
||||
};
|
||||
return m_SetupTypes;
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6cccd50ebf7384242bda4d7bcb282ebf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEditor.TestTools.TestRunner
|
||||
{
|
||||
internal class StadiaPlatformSetup : IPlatformSetup
|
||||
{
|
||||
public void Setup()
|
||||
{
|
||||
}
|
||||
|
||||
public void PostBuildAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void PostSuccessfulBuildAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void PostSuccessfulLaunchAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void CleanUp()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa19b42bd3dc35e40a618448bd330270
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEditor.TestTools.TestRunner
|
||||
{
|
||||
internal class SwitchPlatformSetup : IPlatformSetup
|
||||
{
|
||||
public void Setup()
|
||||
{
|
||||
EditorUserBuildSettings.switchCreateRomFile = true;
|
||||
EditorUserBuildSettings.switchNVNGraphicsDebugger = false;
|
||||
#if UNITY_2020_1_OR_NEWER
|
||||
EditorUserBuildSettings.switchNVNDrawValidation_Heavy = true; // catches more graphics errors
|
||||
#else
|
||||
EditorUserBuildSettings.switchNVNDrawValidation = true; // catches more graphics errors
|
||||
#endif
|
||||
EditorUserBuildSettings.development = true;
|
||||
EditorUserBuildSettings.switchRedirectWritesToHostMount = true;
|
||||
|
||||
// We can use these when more debugging is required:
|
||||
//EditorUserBuildSettings.switchNVNDrawValidation = false; // cannot be used with shader debug
|
||||
//EditorUserBuildSettings.switchNVNGraphicsDebugger = true;
|
||||
//EditorUserBuildSettings.switchNVNShaderDebugging = true;
|
||||
//EditorUserBuildSettings.switchCreateSolutionFile = true; // for shorter iteration time
|
||||
//EditorUserBuildSettings.allowDebugging = true; // managed debugger can be attached
|
||||
}
|
||||
|
||||
public void PostBuildAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void PostSuccessfulBuildAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void PostSuccessfulLaunchAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void CleanUp()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: adf7bea9401c1834380d55601add6cfb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using UnityEditor.Build;
|
||||
|
||||
namespace UnityEditor.TestTools.TestRunner
|
||||
{
|
||||
internal class UwpPlatformSetup : IPlatformSetup
|
||||
{
|
||||
private const string k_SettingsBuildConfiguration = "BuildConfiguration";
|
||||
private bool m_InternetClientServer;
|
||||
private bool m_PrivateNetworkClientServer;
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
m_InternetClientServer = PlayerSettings.WSA.GetCapability(PlayerSettings.WSACapability.InternetClientServer);
|
||||
m_PrivateNetworkClientServer = PlayerSettings.WSA.GetCapability(PlayerSettings.WSACapability.PrivateNetworkClientServer);
|
||||
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.InternetClientServer, true);
|
||||
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.PrivateNetworkClientServer, true);
|
||||
|
||||
// This setting is initialized only when Window Store App is selected from the Build Settings window, and
|
||||
// is typically an empty strings when running tests via UTR on the command-line.
|
||||
bool wsaSettingNotInitialized = string.IsNullOrEmpty(EditorUserBuildSettings.wsaArchitecture);
|
||||
|
||||
// If WSA build settings aren't fully initialized or running from a build machine, specify a default build configuration.
|
||||
// Otherwise we can use the existing configuration specified by the user in Build Settings.
|
||||
if (Environment.GetEnvironmentVariable("UNITY_THISISABUILDMACHINE") == "1" || wsaSettingNotInitialized)
|
||||
{
|
||||
#if UNITY_2021_3_OR_NEWER
|
||||
#else
|
||||
EditorUserBuildSettings.wsaSubtarget = WSASubtarget.PC;
|
||||
#endif
|
||||
|
||||
EditorUserBuildSettings.wsaArchitecture = "x64";
|
||||
EditorUserBuildSettings.SetPlatformSettings(BuildPipeline.GetBuildTargetName(BuildTarget.WSAPlayer), k_SettingsBuildConfiguration, WSABuildType.Debug.ToString());
|
||||
EditorUserBuildSettings.wsaUWPBuildType = WSAUWPBuildType.ExecutableOnly;
|
||||
#if UNITY_2021_2_OR_NEWER
|
||||
PlayerSettings.SetIl2CppCompilerConfiguration(NamedBuildTarget.WindowsStoreApps, Il2CppCompilerConfiguration.Debug);
|
||||
#else
|
||||
PlayerSettings.SetIl2CppCompilerConfiguration(BuildTargetGroup.WSA, Il2CppCompilerConfiguration.Debug);
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void PostBuildAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void PostSuccessfulBuildAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void PostSuccessfulLaunchAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void CleanUp()
|
||||
{
|
||||
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.InternetClientServer, m_InternetClientServer);
|
||||
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.PrivateNetworkClientServer, m_PrivateNetworkClientServer);
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 667c6ad86a0b7a548aaa5c287f2c2861
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEditor.TestTools.TestRunner
|
||||
{
|
||||
|
||||
#if !UNITY_2021_1_OR_NEWER
|
||||
|
||||
internal class XboxOnePlatformSetup : IPlatformSetup
|
||||
{
|
||||
private XboxOneDeployMethod oldXboxOneDeployMethod;
|
||||
private XboxOneDeployDrive oldXboxOneDeployDrive;
|
||||
private string oldXboxOneAdditionalDebugPorts;
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
oldXboxOneDeployMethod = EditorUserBuildSettings.xboxOneDeployMethod;
|
||||
oldXboxOneDeployDrive = EditorUserBuildSettings.xboxOneDeployDrive;
|
||||
oldXboxOneAdditionalDebugPorts = EditorUserBuildSettings.xboxOneAdditionalDebugPorts;
|
||||
|
||||
EditorUserBuildSettings.xboxOneDeployMethod = XboxOneDeployMethod.Package;
|
||||
EditorUserBuildSettings.xboxOneDeployDrive = XboxOneDeployDrive.Default;
|
||||
|
||||
// This causes the XboxOne post processing systems to open this port in your package manifest.
|
||||
// In addition it will open the ephemeral range for debug connections as well.
|
||||
// Failure to do this will cause connection problems.
|
||||
EditorUserBuildSettings.xboxOneAdditionalDebugPorts = "34999";
|
||||
}
|
||||
|
||||
public void PostBuildAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void PostSuccessfulBuildAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void PostSuccessfulLaunchAction()
|
||||
{
|
||||
}
|
||||
|
||||
public void CleanUp()
|
||||
{
|
||||
EditorUserBuildSettings.xboxOneDeployMethod = oldXboxOneDeployMethod;
|
||||
EditorUserBuildSettings.xboxOneDeployDrive = oldXboxOneDeployDrive;
|
||||
|
||||
// This causes the XboxOne post processing systems to open this port in your package manifest.
|
||||
// In addition it will open the ephemeral range for debug connections as well.
|
||||
// Failure to do this will cause connection problems.
|
||||
EditorUserBuildSettings.xboxOneAdditionalDebugPorts = oldXboxOneAdditionalDebugPorts;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aed7ab02155e43341a2dbcb7bc17c160
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user