Skip to content

Commit dcf29f6

Browse files
author
Unity Technologies
committed
Unity 2023.1.0a4 C# reference source code
1 parent 3f0dae7 commit dcf29f6

89 files changed

Lines changed: 3711 additions & 1681 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Editor/Mono/BuildPipeline/AssemblyStripper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ private static void GetUnityLinkerPlatformStringsFromBuildTarget(BuildTarget tar
620620
platform = "Android";
621621
architecture = "";
622622
break;
623-
case BuildTarget.CloudRendering:
623+
case BuildTarget.LinuxHeadlessSimulation:
624624
case BuildTarget.StandaloneLinux64:
625625
platform = "Linux";
626626
architecture = "x64";

Editor/Mono/BuildPipeline/BuildFailedException.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ namespace UnityEditor.Build
1010
[RequiredByNativeCode]
1111
public class BuildFailedException : Exception
1212
{
13+
// We can set the BuildFailedException to be silent if we know we have already printed an
14+
// error message for the failure. That is the case when the BuildFailedException originates
15+
// from the BeeBuildPostprocessor. That way we can avoid redundant error messages about builds
16+
// failing.
17+
private bool m_Silent;
18+
19+
internal BuildFailedException(string message, bool silent = false) :
20+
base(message)
21+
{
22+
m_Silent = silent;
23+
}
24+
1325
public BuildFailedException(string message) :
1426
base(message)
1527
{
@@ -20,6 +32,12 @@ public BuildFailedException(Exception innerException) :
2032
{
2133
}
2234

35+
[RequiredByNativeCode]
36+
private bool IsSilent()
37+
{
38+
return m_Silent;
39+
}
40+
2341
[RequiredByNativeCode]
2442
private Exception BuildFailedException_GetInnerException()
2543
{

Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private static bool GetTargetPlatformAndArchFromBuildTarget(BuildTarget target,
109109
switch (target)
110110
{
111111
case BuildTarget.StandaloneLinux64:
112-
case BuildTarget.CloudRendering:
112+
case BuildTarget.LinuxHeadlessSimulation:
113113
targetPlatform = "linux";
114114
targetArch = "x86_64";
115115
return true;

Editor/Mono/BuildPipeline/NamedBuildTarget.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ namespace UnityEditor.Build
2424
"Nintendo Switch",
2525
"Stadia",
2626
"CloudRendering",
27+
"LinuxHeadlessSimulation",
2728
"Lumin",
2829
"GameCoreScarlett",
2930
"GameCoreXboxOne",
@@ -44,7 +45,9 @@ namespace UnityEditor.Build
4445
public static readonly NamedBuildTarget tvOS = new NamedBuildTarget("tvOS");
4546
public static readonly NamedBuildTarget NintendoSwitch = new NamedBuildTarget("Nintendo Switch");
4647
public static readonly NamedBuildTarget Stadia = new NamedBuildTarget("Stadia");
47-
public static readonly NamedBuildTarget CloudRendering = new NamedBuildTarget("CloudRendering");
48+
public static readonly NamedBuildTarget LinuxHeadlessSimulation = new NamedBuildTarget("LinuxHeadlessSimulation");
49+
[System.Obsolete("CloudRendering is deprecated, please use LinuxHeadlessSimulation (UnityUpgradable) -> LinuxHeadlessSimulation", false)]
50+
public static readonly NamedBuildTarget CloudRendering = LinuxHeadlessSimulation;
4851
public static readonly NamedBuildTarget EmbeddedLinux = new NamedBuildTarget("EmbeddedLinux");
4952
public static readonly NamedBuildTarget QNX = new NamedBuildTarget("QNX");
5053

@@ -97,8 +100,8 @@ public static NamedBuildTarget FromBuildTargetGroup(BuildTargetGroup buildTarget
97100
return NamedBuildTarget.NintendoSwitch;
98101
case BuildTargetGroup.Stadia:
99102
return NamedBuildTarget.Stadia;
100-
case BuildTargetGroup.CloudRendering:
101-
return NamedBuildTarget.CloudRendering;
103+
case BuildTargetGroup.LinuxHeadlessSimulation:
104+
return NamedBuildTarget.LinuxHeadlessSimulation;
102105
case BuildTargetGroup.EmbeddedLinux:
103106
return NamedBuildTarget.EmbeddedLinux;
104107
case BuildTargetGroup.QNX:

Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,14 @@ static public void Postprocess(BuildTargetGroup targetGroup, BuildTarget target,
373373
{
374374
postprocessor.PostProcess(args, out props);
375375
}
376-
catch (System.Exception e)
376+
catch (BuildFailedException)
377+
{
378+
throw;
379+
}
380+
catch (Exception e)
377381
{
378382
// Rethrow exceptions during build postprocessing as BuildFailedException, so we don't pretend the build was fine.
379-
throw new UnityEditor.Build.BuildFailedException(e);
383+
throw new BuildFailedException(e);
380384
}
381385
report.AddAppendix(props);
382386

Editor/Mono/BuildPlayerWindowBuildMethods.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,8 @@ internal static void CallBuildMethods(bool askForBuildLocation, BuildOptions def
9797
else
9898
DefaultBuildMethods.BuildPlayer(options);
9999
}
100-
catch (BuildMethodException e)
100+
catch (BuildMethodException)
101101
{
102-
if (!string.IsNullOrEmpty(e.Message))
103-
Debug.LogError(e);
104102
}
105103
finally
106104
{
@@ -190,8 +188,8 @@ public static void BuildPlayer(BuildPlayerOptions options)
190188
// it should not be automatically deleted by the Unity Editor, even if it is empty (case 1073851)
191189
if (options.target != BuildTarget.XboxOne && !locationPathExistedBeforeBuild)
192190
DeleteBuildFolderIfEmpty(report.summary.outputPath);
193-
Debug.LogError(resultStr);
194-
throw new BuildMethodException(report.SummarizeErrors());
191+
Debug.LogError(resultStr + "\n" + report.SummarizeErrors());
192+
throw new BuildMethodException();
195193
default:
196194
Debug.Log(resultStr);
197195
break;

Editor/Mono/BuildTarget.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,11 @@ public enum BuildTarget
122122

123123
Stadia = 40,
124124

125+
[System.Obsolete("CloudRendering is deprecated, please use LinuxHeadlessSimulation (UnityUpgradable) -> LinuxHeadlessSimulation", false)]
125126
CloudRendering = 41,
126127

128+
LinuxHeadlessSimulation = 41, // LinuxHeadlessSimulation intenionally set to the same as CloudRendering
129+
127130
[System.Obsolete("GameCoreScarlett is deprecated, please use GameCoreXboxSeries (UnityUpgradable) -> GameCoreXboxSeries", false)]
128131
GameCoreScarlett = 42,
129132
GameCoreXboxSeries = 42, // GameCoreXboxSeries intentionally set to the same as GameCoreScarlett

Editor/Mono/BuildTargetConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal static class BuildTargetConverter
2222
return RuntimePlatform.PS5;
2323
case BuildTarget.StandaloneLinux64:
2424
return RuntimePlatform.LinuxPlayer;
25-
case BuildTarget.CloudRendering:
25+
case BuildTarget.LinuxHeadlessSimulation:
2626
return RuntimePlatform.LinuxPlayer;
2727
case BuildTarget.StandaloneOSX:
2828
return RuntimePlatform.OSXPlayer;

Editor/Mono/BuildTargetGroup.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ public enum BuildTargetGroup
9999

100100
Stadia = 29,
101101

102+
[System.Obsolete("CloudRendering is deprecated, please use LinuxHeadlessSimulation (UnityUpgradable) -> LinuxHeadlessSimulation", false)]
102103
CloudRendering = 30,
104+
LinuxHeadlessSimulation = 30,
103105

104106
[System.Obsolete("GameCoreScarlett is deprecated, please use GameCoreXboxSeries (UnityUpgradable) -> GameCoreXboxSeries", false)]
105107
GameCoreScarlett = 31,

Editor/Mono/EditorGUI.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,21 @@ public static bool EndChangeCheck()
476476
return changed;
477477
}
478478

479+
public struct MixedValueScope : IDisposable
480+
{
481+
bool m_DefaultMixedValue;
482+
483+
public MixedValueScope(bool newMixedValue)
484+
{
485+
m_DefaultMixedValue = showMixedValue;
486+
showMixedValue = newMixedValue;
487+
}
488+
void IDisposable.Dispose()
489+
{
490+
showMixedValue = m_DefaultMixedValue;
491+
}
492+
}
493+
479494
internal class RecycledTextEditor : TextEditor
480495
{
481496
internal static bool s_ActuallyEditing = false; // internal so we can save this state.

0 commit comments

Comments
 (0)