Skip to content

Commit da51b77

Browse files
author
Unity Technologies
committed
Unity 2023.2.0a15 C# reference source code
1 parent c0e1b83 commit da51b77

File tree

139 files changed

+5610
-1820
lines changed

Some content is hidden

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

139 files changed

+5610
-1820
lines changed

Editor/Mono/Animation/AnimationWindow/CurveEditor.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3833,11 +3833,6 @@ WrapMode WrapModeIconPopup(Keyframe key, WrapMode oldWrap, float hOffset)
38333833
case EventType.MouseDown:
38343834
if (evt.button == 0 && r.Contains(evt.mousePosition))
38353835
{
3836-
if (Application.platform == RuntimePlatform.OSXEditor)
3837-
{
3838-
r.y = r.y - selectedPopupIndex * 16 - 19;
3839-
}
3840-
38413836
EditorGUI.PopupCallbackInfo.instance = new EditorGUI.PopupCallbackInfo(controlID);
38423837
EditorUtility.DisplayCustomMenu(r, popupStrings, selectedPopupIndex, EditorGUI.PopupCallbackInfo.instance.SetEnumValueDelegate, null);
38433838
GUIUtility.keyboardControl = controlID;
@@ -3847,11 +3842,6 @@ WrapMode WrapModeIconPopup(Keyframe key, WrapMode oldWrap, float hOffset)
38473842
case EventType.KeyDown:
38483843
if (evt.MainActionKeyForControl(controlID))
38493844
{
3850-
if (Application.platform == RuntimePlatform.OSXEditor)
3851-
{
3852-
r.y = r.y - selectedPopupIndex * 16 - 19;
3853-
}
3854-
38553845
EditorGUI.PopupCallbackInfo.instance = new EditorGUI.PopupCallbackInfo(controlID);
38563846
EditorUtility.DisplayCustomMenu(r, popupStrings, selectedPopupIndex, EditorGUI.PopupCallbackInfo.instance.SetEnumValueDelegate, null);
38573847
evt.Use();

Editor/Mono/AssetPreviewUpdater.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
44

55
using UnityEngine;
6+
using UnityEngine.Rendering;
67

78
namespace UnityEditor
89
{
@@ -19,6 +20,9 @@ public static Texture2D CreatePreview(Object obj, Object[] subAssets, string ass
1920
if (obj == null)
2021
return null;
2122

23+
if (!RenderPipelineManager.pipelineSwitchCompleted)
24+
return null;
25+
2226
System.Type type = CustomEditorAttributes.FindCustomEditorType(obj, false);
2327
if (type == null)
2428
return null;

Editor/Mono/BuildPipeline/BuildPlatform.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,5 @@ public List<BuildPlatform> GetValidPlatforms()
191191
{
192192
return GetValidPlatforms(false);
193193
}
194-
195-
public static string[] GetValidPlatformNames()
196-
{
197-
return instance.GetValidPlatforms().ConvertAll(platform => platform.name).ToArray();
198-
}
199194
}
200195
}

Editor/Mono/BuildPipeline/NamedBuildTarget.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ namespace UnityEditor.Build
2121
"PS4",
2222
"XboxOne",
2323
"tvOS",
24+
"Bratwurst",
2425
"Nintendo Switch",
2526
"Stadia",
2627
"CloudRendering",
@@ -44,6 +45,7 @@ namespace UnityEditor.Build
4445
public static readonly NamedBuildTarget PS5 = new NamedBuildTarget("PS5");
4546
public static readonly NamedBuildTarget XboxOne = new NamedBuildTarget("XboxOne");
4647
public static readonly NamedBuildTarget tvOS = new NamedBuildTarget("tvOS");
48+
public static readonly NamedBuildTarget Bratwurst = new NamedBuildTarget("Bratwurst");
4749
public static readonly NamedBuildTarget NintendoSwitch = new NamedBuildTarget("Nintendo Switch");
4850
[System.Obsolete("Stadia has been removed in 2023.1")]
4951
public static readonly NamedBuildTarget Stadia = new NamedBuildTarget("Stadia");
@@ -98,6 +100,8 @@ public static NamedBuildTarget FromBuildTargetGroup(BuildTargetGroup buildTarget
98100
return NamedBuildTarget.XboxOne;
99101
case BuildTargetGroup.tvOS:
100102
return NamedBuildTarget.tvOS;
103+
case BuildTargetGroup.Bratwurst:
104+
return NamedBuildTarget.Bratwurst;
101105
case BuildTargetGroup.Switch:
102106
return NamedBuildTarget.NintendoSwitch;
103107
case BuildTargetGroup.LinuxHeadlessSimulation:

Editor/Mono/BuildPipeline/EnsureSinglePipelineOnBuild.cs renamed to Editor/Mono/BuildPipeline/RenderPipeline/EnsureSinglePipelineOnBuild.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace UnityEditor.Build.Rendering
99
{
1010
class EnsureSinglePipelineOnBuild : IPreprocessBuildWithReport
1111
{
12-
public int callbackOrder => int.MinValue; // We want it to be the first preprocessor to be executed
12+
public int callbackOrder => (int) ExecutionOrder.EnsureSinglePipeline;
1313

1414
public void OnPreprocessBuild(BuildReport report)
1515
{
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Unity C# reference source
2+
// Copyright (c) Unity Technologies. For terms of use, see
3+
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
4+
5+
namespace UnityEditor.Build.Rendering
6+
{
7+
enum ExecutionOrder
8+
{
9+
EnsureSinglePipeline = int.MinValue,
10+
StripRenderPipelineGlobalSettingsAsset,
11+
}
12+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Unity C# reference source
2+
// Copyright (c) Unity Technologies. For terms of use, see
3+
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
4+
5+
using UnityEditor.Build.Reporting;
6+
using UnityEditor.Rendering;
7+
using UnityEngine;
8+
using UnityEngine.Pool;
9+
using UnityEngine.Rendering;
10+
11+
namespace UnityEditor.Build.Rendering
12+
{
13+
class RenderPipelineGlobalSettingsStripper : IPreprocessBuildWithReport, IPostprocessBuildWithReport
14+
{
15+
public int callbackOrder => (int) ExecutionOrder.StripRenderPipelineGlobalSettingsAsset;
16+
17+
public void OnPreprocessBuild(BuildReport report)
18+
{
19+
var renderPipelineAssets = ListPool<RenderPipelineAsset>.Get();
20+
21+
var buildTargetGroupName = BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget).ToString();
22+
QualitySettings.GetAllRenderPipelineAssetsForPlatform(buildTargetGroupName, ref renderPipelineAssets);
23+
24+
if (renderPipelineAssets.Count > 0 && renderPipelineAssets[0] != null)
25+
{
26+
// Top level stripping, even if there are multiple pipelines registered into the project, as we are building we are making sure the only one that is being transferred into the player is the current one.
27+
GraphicsSettings.currentRenderPipelineGlobalSettings = EditorGraphicsSettings.GetSettingsForRenderPipeline(renderPipelineAssets[0].renderPipelineType);
28+
}
29+
30+
ListPool<RenderPipelineAsset>.Release(renderPipelineAssets);
31+
}
32+
33+
public void OnPostprocessBuild(BuildReport report)
34+
{
35+
GraphicsSettings.currentRenderPipelineGlobalSettings = null;
36+
}
37+
}
38+
}

Editor/Mono/BuildTarget.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ public enum BuildTarget
140140

141141
QNX = 46,
142142

143+
Bratwurst = 47,
144+
143145
// obsolete identifiers. We're using different values so that ToString() works.
144146
[System.Obsolete("Use iOS instead (UnityUpgradable) -> iOS", true)]
145147
iPhone = -1,

Editor/Mono/BuildTargetGroup.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,7 @@ public enum BuildTargetGroup
115115
EmbeddedLinux = 34,
116116

117117
QNX = 35,
118+
119+
Bratwurst = 36,
118120
}
119121
}

Editor/Mono/ContainerWindow.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ internal partial class ContainerWindow : ScriptableObject
4444
private static ContainerWindow s_MainWindow;
4545
static internal ContainerWindow mainWindow { get => s_MainWindow; }
4646

47+
static readonly string s_ContextMenuID = "UnityEditor.UIElements.EditorMenuExtensions+ContextMenu";
48+
4749
private static class Styles
4850
{
4951
public static float borderSize => macEditor ? osxBorderSize : winBorderSize;
@@ -490,7 +492,7 @@ public bool IsMainWindow()
490492
internal void SaveGeometry()
491493
{
492494
string ID = windowID;
493-
if (String.IsNullOrEmpty(ID))
495+
if (string.IsNullOrEmpty(ID))
494496
return;
495497

496498
// save position/size
@@ -507,10 +509,16 @@ public void Save()
507509
SaveGeometry();
508510
}
509511

512+
bool IsValidContextMenu()
513+
{
514+
return string.Equals(s_ContextMenuID, windowID) && m_PixelRect.x == 0 && m_PixelRect.y == 0;
515+
}
516+
510517
internal void LoadGeometry(bool loadPosition)
511518
{
512519
string ID = windowID;
513-
if (String.IsNullOrEmpty(ID))
520+
// Check for invalid ID and validate context menu to avoid soft locks on invalid positions UW-105
521+
if (string.IsNullOrEmpty(ID) || IsValidContextMenu())
514522
return;
515523

516524
// get position/size

0 commit comments

Comments
 (0)