Skip to content

Commit d0fe81a

Browse files
author
Unity Technologies
committed
Unity 2022.1.0a16 C# reference source code
1 parent 3fcad4b commit d0fe81a

File tree

289 files changed

+22908
-7835
lines changed

Some content is hidden

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

289 files changed

+22908
-7835
lines changed

Editor/IncrementalBuildPipeline/BeeBuildProgramCommon.Data/BeeBuildProgramCommon.Data.gen.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
77
<EnableDefaultItems>false</EnableDefaultItems>
88
<LangVersion>latest</LangVersion>
9-
<NoWarn></NoWarn>
9+
<NoWarn>1071</NoWarn>
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<Compile Include="Data.cs" />

Editor/IncrementalBuildPipeline/BeeBuildProgramCommon.Data/Data.cs

+1
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ public class ConfigurationData
3535
public string UnitySourceCodePath;
3636
public bool AdvancedLicense;
3737
public bool Batchmode;
38+
public bool EmitDataForBeeWhy;
3839
}
3940
}

Editor/IncrementalBuildPipeline/PlayerBuildProgramLibrary.Data/PlayerBuildProgramLibrary.Data.gen.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
77
<EnableDefaultItems>false</EnableDefaultItems>
88
<LangVersion>latest</LangVersion>
9-
<NoWarn></NoWarn>
9+
<NoWarn>1071</NoWarn>
1010
<AssemblyName>PlayerBuildProgramLibrary.Data</AssemblyName>
1111
</PropertyGroup>
1212
<ItemGroup>

Editor/IncrementalBuildPipeline/ScriptCompilationBuildProgram.Data/ScriptCompilationBuildProgram.Data.gen.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
77
<EnableDefaultItems>false</EnableDefaultItems>
88
<LangVersion>latest</LangVersion>
9-
<NoWarn></NoWarn>
9+
<NoWarn>1071</NoWarn>
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<Compile Include="Data.cs" />

Editor/Mono/AssetDatabase/AssetDatabase.deprecated.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,19 @@ public partial class AssetDatabaseExperimental
6565
[Obsolete("AssetDatabaseExperimental.IsCacheServerEnabled() has been deprecated. Use AssetDatabase.IsCacheServerEnabled() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.IsCacheServerEnabled(*)", false)]
6666
public extern static bool IsCacheServerEnabled();
6767

68-
[Obsolete("AssetDatabaseExperimental.SetImporterOverride<T>() has been deprecated. Use AssetDatabase.SetImporterOverride<T>() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.SetImporterOverride<T>(*)", false)]
68+
[Obsolete("AssetDatabaseExperimental.SetImporterOverride<T>() has been deprecated. Use AssetDatabase.SetImporterOverride<T>() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.SetImporterOverride<T>(*)", true)]
6969
public static void SetImporterOverride<T>(string path)
7070
where T : ScriptedImporter
7171
{
7272
AssetDatabase.SetImporterOverrideInternal(path, typeof(T));
7373
}
7474

7575
[FreeFunction("AssetDatabase::GetImporterOverride")]
76-
[Obsolete("AssetDatabaseExperimental.GetImporterOverride() has been deprecated. Use AssetDatabase.GetImporterOverride() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetImporterOverride(*)", false)]
76+
[Obsolete("AssetDatabaseExperimental.GetImporterOverride() has been deprecated. Use AssetDatabase.GetImporterOverride() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetImporterOverride(*)", true)]
7777
extern public static System.Type GetImporterOverride(string path);
7878

79-
[FreeFunction("AssetDatabase::GetAvailableImporterTypes")]
80-
[Obsolete("AssetDatabaseExperimental.GetAvailableImporterTypes() has been deprecated. Use AssetDatabase.GetAvailableImporterTypes() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetAvailableImporterTypes(*)", false)]
79+
[FreeFunction("AssetDatabase::GetAvailableImporters")]
80+
[Obsolete("AssetDatabaseExperimental.GetAvailableImporterTypes() has been deprecated. Use AssetDatabase.GetAvailableImporters() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetAvailableImporters(*)", true)]
8181
extern public static Type[] GetAvailableImporterTypes(string path);
8282

8383
[FreeFunction("AcceleratorClientCanConnectTo")]

Editor/Mono/Commands/GOCreationCommands.cs

+1
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ static void CreateParticleSystem(MenuCommand menuCommand)
411411
go.GetComponent<Transform>().SetLocalEulerAngles(new Vector3(-90, 0, 0), RotationOrder.OrderZXY);
412412
var renderer = go.GetComponent<ParticleSystemRenderer>();
413413
renderer.material = Material.GetDefaultParticleMaterial();
414+
renderer.oldTrailMaterial = Material.GetDefaultLineMaterial(); // This trick means that when enabling the trails module for the first time, there is a default material assigned
414415
Place(go, parent);
415416
}
416417

Editor/Mono/ContainerWindow.bindings.cs

+13-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ internal enum ShowMode
2525
// Like PopupMenu, but without keyboard focus
2626
Tooltip = 6,
2727
// Modal Utility window
28-
ModalUtility = 7
28+
ModalUtility = 7,
29+
// Show as fullscreen window
30+
Fullscreen = 8
2931
}
3032

3133
//[StaticAccessor("ContainerWindowBindings", StaticAccessorType.DoubleColon)]
@@ -63,6 +65,12 @@ public extern Rect position
6365
[FreeFunction(k_ScriptingPrefix + "ToggleMaximize", HasExplicitThis = true)]
6466
public extern void ToggleMaximize();
6567

68+
[FreeFunction(k_ScriptingPrefix + "ToggleFullscreen", HasExplicitThis = true)]
69+
internal extern void ToggleFullscreen(int displayIndex = 0);
70+
71+
[FreeFunction(k_ScriptingPrefix + "IsFullscreen", HasExplicitThis = true)]
72+
internal extern bool IsFullscreen();
73+
6674
[FreeFunction(k_ScriptingPrefix + "MoveInFrontOf", HasExplicitThis = true)]
6775
public extern void MoveInFrontOf(ContainerWindow other);
6876

@@ -76,6 +84,9 @@ public extern Rect position
7684
[FreeFunction(k_ScriptingPrefix + "SendCaptionEvent", HasExplicitThis = true)]
7785
public extern void SendCaptionEvent(bool mouseDown);
7886

87+
[FreeFunction(k_ScriptingPrefix + "GetDisplayId", HasExplicitThis = true)]
88+
internal extern int GetDisplayId();
89+
7990
// Close the editor window.
8091
[FreeFunction(k_ScriptingPrefix + "InternalClose", HasExplicitThis = true)]
8192
public extern void InternalClose();
@@ -84,7 +95,7 @@ public extern Rect position
8495
private extern void Internal_SetMinMaxSizes(Vector2 minSize, Vector2 maxSize);
8596

8697
[FreeFunction(k_ScriptingPrefix + "Internal_Show", HasExplicitThis = true, ThrowsException = true)]
87-
private extern void Internal_Show(Rect r, int showMode, Vector2 minSize, Vector2 maxSize);
98+
private extern void Internal_Show(Rect r, int showMode, Vector2 minSize, Vector2 maxSize, int displayIndex = 0);
8899

89100
[FreeFunction(k_ScriptingPrefix + "Internal_BringLiveAfterCreation", HasExplicitThis = true)]
90101
private extern void Internal_BringLiveAfterCreation(bool displayImmediately, bool setFocus, bool showMaximized);

Editor/Mono/ContainerWindow.cs

+7-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ internal partial class ContainerWindow : ScriptableObject
2424
[SerializeField] Vector2 m_MaxSize = new Vector2(8192, 8192);
2525
[SerializeField] bool m_Maximized;
2626

27+
internal int m_DisplayIndex;
28+
internal bool m_IsFullscreenContainer;
29+
2730
internal bool m_DontSaveToLayout = false;
2831
private bool m_HasUnsavedChanges = false;
2932
private List<EditorWindow> m_UnsavedEditorWindows;
@@ -144,20 +147,21 @@ internal void ShowPopupWithMode(ShowMode mode, bool giveFocus)
144147
static Color skinBackgroundColor => EditorGUIUtility.isProSkin ? darkSkinColor : lightSkinColor;
145148

146149
// Show the editor window.
147-
public void Show(ShowMode showMode, bool loadPosition, bool displayImmediately, bool setFocus)
150+
public void Show(ShowMode showMode, bool loadPosition, bool displayImmediately, bool setFocus, int displayIndex = 0)
148151
{
149152
try
150153
{
151154
if (showMode == ShowMode.MainWindow && s_MainWindow && s_MainWindow != this)
152155
throw new InvalidOperationException("Trying to create a second main window from layout when one already exists.");
153156

154-
bool useMousePos = showMode == ShowMode.AuxWindow;
157+
bool useMousePos = showMode == ShowMode.AuxWindow || showMode == ShowMode.Fullscreen;
155158
if (showMode == ShowMode.AuxWindow)
156159
showMode = ShowMode.Utility;
157160

158161
if (showMode == ShowMode.Utility
159162
|| showMode == ShowMode.ModalUtility
160163
|| showMode == ShowMode.AuxWindow
164+
|| showMode == ShowMode.Fullscreen
161165
|| IsPopup(showMode))
162166
m_DontSaveToLayout = true;
163167

@@ -171,7 +175,7 @@ public void Show(ShowMode showMode, bool loadPosition, bool displayImmediately,
171175

172176
var initialMaximizedState = m_Maximized;
173177

174-
Internal_Show(m_PixelRect, m_ShowMode, m_MinSize, m_MaxSize);
178+
Internal_Show(m_PixelRect, m_ShowMode, m_MinSize, m_MaxSize, displayIndex);
175179

176180
// Tell the main view its now in this window (quick hack to get platform-specific code to move its views to the right window)
177181
if (m_RootView)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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 System;
6+
using UnityEngine;
7+
8+
namespace UnityEditor
9+
{
10+
[Serializable]
11+
internal class EditorDisplayFullscreenSetting
12+
{
13+
public enum Mode
14+
{
15+
DoNothing,
16+
FullscreenOnPlaymode,
17+
AlwaysFullscreen
18+
}
19+
20+
public EditorDisplayFullscreenSetting(int id, string name)
21+
{
22+
displayId = id;
23+
displayName = name;
24+
mode = Mode.DoNothing;
25+
enabled = false;
26+
viewWindowTitle = string.Empty;
27+
playModeViewSettings = null;
28+
}
29+
30+
public string displayName;
31+
public int displayId;
32+
33+
public bool enabled;
34+
35+
public Mode mode;
36+
37+
public string viewWindowTitle;
38+
39+
[SerializeReference]
40+
public IPlayModeViewFullscreenSettings playModeViewSettings;
41+
}
42+
}

0 commit comments

Comments
 (0)