Skip to content

Commit

Permalink
Unity 2022.1.0a16 C# reference source code
Browse files Browse the repository at this point in the history
  • Loading branch information
Unity Technologies committed Nov 29, 2021
1 parent 3fcad4b commit d0fe81a
Show file tree
Hide file tree
Showing 289 changed files with 22,908 additions and 7,835 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<EnableDefaultItems>false</EnableDefaultItems>
<LangVersion>latest</LangVersion>
<NoWarn></NoWarn>
<NoWarn>1071</NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Include="Data.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ public class ConfigurationData
public string UnitySourceCodePath;
public bool AdvancedLicense;
public bool Batchmode;
public bool EmitDataForBeeWhy;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<EnableDefaultItems>false</EnableDefaultItems>
<LangVersion>latest</LangVersion>
<NoWarn></NoWarn>
<NoWarn>1071</NoWarn>
<AssemblyName>PlayerBuildProgramLibrary.Data</AssemblyName>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<EnableDefaultItems>false</EnableDefaultItems>
<LangVersion>latest</LangVersion>
<NoWarn></NoWarn>
<NoWarn>1071</NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Include="Data.cs" />
Expand Down
8 changes: 4 additions & 4 deletions Editor/Mono/AssetDatabase/AssetDatabase.deprecated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ public partial class AssetDatabaseExperimental
[Obsolete("AssetDatabaseExperimental.IsCacheServerEnabled() has been deprecated. Use AssetDatabase.IsCacheServerEnabled() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.IsCacheServerEnabled(*)", false)]
public extern static bool IsCacheServerEnabled();

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

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

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

[FreeFunction("AcceleratorClientCanConnectTo")]
Expand Down
1 change: 1 addition & 0 deletions Editor/Mono/Commands/GOCreationCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ static void CreateParticleSystem(MenuCommand menuCommand)
go.GetComponent<Transform>().SetLocalEulerAngles(new Vector3(-90, 0, 0), RotationOrder.OrderZXY);
var renderer = go.GetComponent<ParticleSystemRenderer>();
renderer.material = Material.GetDefaultParticleMaterial();
renderer.oldTrailMaterial = Material.GetDefaultLineMaterial(); // This trick means that when enabling the trails module for the first time, there is a default material assigned
Place(go, parent);
}

Expand Down
15 changes: 13 additions & 2 deletions Editor/Mono/ContainerWindow.bindings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ internal enum ShowMode
// Like PopupMenu, but without keyboard focus
Tooltip = 6,
// Modal Utility window
ModalUtility = 7
ModalUtility = 7,
// Show as fullscreen window
Fullscreen = 8
}

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

[FreeFunction(k_ScriptingPrefix + "ToggleFullscreen", HasExplicitThis = true)]
internal extern void ToggleFullscreen(int displayIndex = 0);

[FreeFunction(k_ScriptingPrefix + "IsFullscreen", HasExplicitThis = true)]
internal extern bool IsFullscreen();

[FreeFunction(k_ScriptingPrefix + "MoveInFrontOf", HasExplicitThis = true)]
public extern void MoveInFrontOf(ContainerWindow other);

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

[FreeFunction(k_ScriptingPrefix + "GetDisplayId", HasExplicitThis = true)]
internal extern int GetDisplayId();

// Close the editor window.
[FreeFunction(k_ScriptingPrefix + "InternalClose", HasExplicitThis = true)]
public extern void InternalClose();
Expand All @@ -84,7 +95,7 @@ public extern Rect position
private extern void Internal_SetMinMaxSizes(Vector2 minSize, Vector2 maxSize);

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

[FreeFunction(k_ScriptingPrefix + "Internal_BringLiveAfterCreation", HasExplicitThis = true)]
private extern void Internal_BringLiveAfterCreation(bool displayImmediately, bool setFocus, bool showMaximized);
Expand Down
10 changes: 7 additions & 3 deletions Editor/Mono/ContainerWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ internal partial class ContainerWindow : ScriptableObject
[SerializeField] Vector2 m_MaxSize = new Vector2(8192, 8192);
[SerializeField] bool m_Maximized;

internal int m_DisplayIndex;
internal bool m_IsFullscreenContainer;

internal bool m_DontSaveToLayout = false;
private bool m_HasUnsavedChanges = false;
private List<EditorWindow> m_UnsavedEditorWindows;
Expand Down Expand Up @@ -144,20 +147,21 @@ internal void ShowPopupWithMode(ShowMode mode, bool giveFocus)
static Color skinBackgroundColor => EditorGUIUtility.isProSkin ? darkSkinColor : lightSkinColor;

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

bool useMousePos = showMode == ShowMode.AuxWindow;
bool useMousePos = showMode == ShowMode.AuxWindow || showMode == ShowMode.Fullscreen;
if (showMode == ShowMode.AuxWindow)
showMode = ShowMode.Utility;

if (showMode == ShowMode.Utility
|| showMode == ShowMode.ModalUtility
|| showMode == ShowMode.AuxWindow
|| showMode == ShowMode.Fullscreen
|| IsPopup(showMode))
m_DontSaveToLayout = true;

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

var initialMaximizedState = m_Maximized;

Internal_Show(m_PixelRect, m_ShowMode, m_MinSize, m_MaxSize);
Internal_Show(m_PixelRect, m_ShowMode, m_MinSize, m_MaxSize, displayIndex);

// Tell the main view its now in this window (quick hack to get platform-specific code to move its views to the right window)
if (m_RootView)
Expand Down
42 changes: 42 additions & 0 deletions Editor/Mono/Display/EditorDisplayFullscreenSetting.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License

using System;
using UnityEngine;

namespace UnityEditor
{
[Serializable]
internal class EditorDisplayFullscreenSetting
{
public enum Mode
{
DoNothing,
FullscreenOnPlaymode,
AlwaysFullscreen
}

public EditorDisplayFullscreenSetting(int id, string name)
{
displayId = id;
displayName = name;
mode = Mode.DoNothing;
enabled = false;
viewWindowTitle = string.Empty;
playModeViewSettings = null;
}

public string displayName;
public int displayId;

public bool enabled;

public Mode mode;

public string viewWindowTitle;

[SerializeReference]
public IPlayModeViewFullscreenSettings playModeViewSettings;
}
}
Loading

0 comments on commit d0fe81a

Please sign in to comment.