Skip to content

Commit ae33015

Browse files
author
Unity Technologies
committed
Unity 6000.6.0a6 C# reference source code
1 parent 3c0289c commit ae33015

591 files changed

Lines changed: 28540 additions & 8197 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/IncrementalBuildPipeline/PlayerBuildProgramLibrary.Data/Data.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ public class Il2CppConfig
104104
public string SysRootPath;
105105
public string ToolChainPath;
106106
public string RelativeDataPath;
107+
public string BclDistributionPath;
107108
public bool GenerateUsymFile;
108109
public string UsymtoolPath;
109110
public BuildProgramLTOMode LtoMode;

Editor/Mono/Animation/AnimationMode.bindings.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ static private AnimationModeDriver DummyDriver()
6767
}
6868

6969
extern public static bool IsPropertyAnimated(Object target, string propertyPath);
70+
[VisibleToOtherModules("UnityEditor.UIToolkitAuthoringModule")]
7071
extern internal static bool IsPropertyCandidate(Object target, string propertyPath);
7172

7273

@@ -111,6 +112,7 @@ public static void StartAnimationMode(AnimationModeDriver driver)
111112
}
112113

113114
// Stops animation playback mode, as used by the animation editor.
115+
[VisibleToOtherModules("UnityEditor.UIToolkitAuthoringModule")]
114116
internal static void StopAnimationPlaybackMode()
115117
{
116118
s_InAnimationPlaybackMode = false;
@@ -119,18 +121,21 @@ internal static void StopAnimationPlaybackMode()
119121
}
120122

121123
// Returns true if the editor is currently in animation playback mode.
124+
[VisibleToOtherModules("UnityEditor.UIToolkitAuthoringModule")]
122125
internal static bool InAnimationPlaybackMode()
123126
{
124127
return s_InAnimationPlaybackMode;
125128
}
126129

127130
// Starts animation mode, as used by the animation editor playback mode.
131+
[VisibleToOtherModules("UnityEditor.UIToolkitAuthoringModule")]
128132
internal static void StartAnimationPlaybackMode()
129133
{
130134
s_InAnimationPlaybackMode = true;
131135
onAnimationPlaybackStart?.Invoke();
132136
}
133137

138+
[VisibleToOtherModules("UnityEditor.UIToolkitAuthoringModule")]
134139
internal static void StopAnimationRecording()
135140
{
136141
s_InAnimationRecordMode = false;
@@ -144,13 +149,15 @@ internal static bool InAnimationRecording()
144149
return s_InAnimationRecordMode;
145150
}
146151

152+
[VisibleToOtherModules("UnityEditor.UIToolkitAuthoringModule")]
147153
internal static void StartAnimationRecording()
148154
{
149155
s_InAnimationRecordMode = true;
150156

151157
onAnimationRecordingStart?.Invoke();
152158
}
153159

160+
[VisibleToOtherModules("UnityEditor.UIToolkitAuthoringModule")]
154161
internal static void StartCandidateRecording(AnimationModeDriver driver)
155162
{
156163
Internal_StartCandidateRecording(driver);
@@ -169,11 +176,13 @@ public static void EndSampling()
169176
}
170177

171178
[NativeMethod(ThrowsException = true)]
179+
[VisibleToOtherModules("UnityEditor.UIToolkitAuthoringModule")]
172180
extern internal static void AddCandidate(EditorCurveBinding binding, PropertyModification modification, bool keepPrefabOverride);
173181

174182
[NativeMethod(ThrowsException = true)]
175183
extern internal static void AddCandidates([NotNull] GameObject gameObject, [NotNull] AnimationClip clip);
176184

185+
[VisibleToOtherModules("UnityEditor.UIToolkitAuthoringModule")]
177186
extern internal static void StopCandidateRecording();
178187

179188
extern internal static bool IsRecordingCandidates();

Editor/Mono/Animation/CurveEditor/CurveEditor.cs

Lines changed: 2 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.Bindings;
67
using UnityEditor;
78
using System;
89
using System.Collections.Generic;
@@ -14,6 +15,7 @@
1415
namespace UnityEditor
1516
{
1617
// External selection interface
18+
[VisibleToOtherModules("UnityEditor.UIToolkitAuthoringModule")]
1719
internal interface ISelectionBinding
1820
{
1921
bool isReadOnly { get; }

Editor/Mono/AssemblyInfo/AssemblyInfo.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
122122
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor-firstpass-testable")]
123123
[assembly: InternalsVisibleTo("Assembly-CSharp-Editor-testable")]
124+
[assembly: InternalsVisibleTo("BuildPipelineTestUtilities")]
124125
[assembly: InternalsVisibleTo("Unity.CrossModule.PlayMode.Tests.Editor")]
125126
[assembly: InternalsVisibleTo("Unity.Module.AssetDatabase.DanglingComponents.Tests.Editor")]
126127
[assembly: InternalsVisibleTo("Unity.Modules.CoreEditor.ComponentUtility.Tests.Editor")]
@@ -225,6 +226,7 @@
225226
[assembly: InternalsVisibleTo("UnityEditor.Switch2.Tests")]
226227

227228
[assembly: InternalsVisibleTo("UnityEditor.BuildProfileModule.Tests")]
229+
[assembly: InternalsVisibleTo("Unity.Modules.Core.CodeCoverage.Tests.Editor")]
228230
//For add Component tests
229231
[assembly: InternalsVisibleTo("Unity.Modules.AdaptivePerformanceEditor.Tests.Playmode.EditorScripts.AssetCreation")]
230232

Editor/Mono/BuildPipeline/BuildPipeline.bindings.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,14 @@ public static BuildReport BuildPlayer(BuildPlayerOptions buildPlayerOptions)
249249
throw new ArgumentException("Non-development build cannot allow auto-connecting the profiler. Either add the Development build option, or remove the ConnectWithProfiler build option.");
250250
}
251251
}
252+
else
253+
{
254+
if ((buildPlayerOptions.options & BuildOptions.EnableCodeCoverage) != 0)
255+
{
256+
if (!BuildProfileModuleUtil.IsBuildTargetSupportedByCoverage(buildPlayerOptions.target))
257+
throw new ArgumentException("Code coverage is unavailable for the selected build target. Remove the EnableCodeCoverage build option.");
258+
}
259+
}
252260

253261
try
254262
{
@@ -421,12 +429,15 @@ internal static BuildReport BuildPlayerData(BuildPlayerDataOptions buildPlayerDa
421429
/// Each entry in <see cref="BuildContentDirectoryParameters.rootAssetPaths"/> must be a <c>ScriptableObject</c>; the build includes those roots and
422430
/// everything they reference (including <see cref="Unity.Loading.LoadableObjectId"/>, <see cref="Unity.Loading.Loadable{T}"/>, and <see cref="Unity.Loading.LoadableSceneId"/>).
423431
/// Creates an <c>outputPath</c> if missing, normalizes path separators, and defaults <see cref="BuildContentDirectoryParameters.name"/> to the output folder name.
432+
///
433+
/// The build uses <see cref="EditorUserBuildSettings.activeBuildTarget"/> and the active subtarget configured for that target in the build settings.
434+
/// Select the intended platform in the **Build Profile** window or through [command line arguments](xref:um-command-line-arguments) so that the active target is set to the desired setting prior to calling this method.
424435
/// </remarks>
425436
///<example>
426437
/// <code source="../../../Modules/ContentBuild/Tests/local.test.build-examples/Editor/BuildPipeline/BuildPipeline_BuildContentDirectory.cs"/>
427438
///</example>
428-
/// <param name="buildParameters">Build settings (paths, roots, platform, options, compression).</param>
429-
/// <returns>The <see cref="BuildReport"/> for this build.</returns>
439+
/// <param name="buildParameters">The build settings to use for the build, such as paths, roots, options, and compression.</param>
440+
/// <returns>The <see cref="BuildReport"/> that contains the results and details of the build.</returns>
430441
/// <exception cref="ArgumentException"><see cref="BuildContentDirectoryParameters.outputPath"/> is null or empty.</exception>
431442
/// <seealso cref="BuildContentDirectoryParameters"/>
432443
/// <seealso cref="Unity.Loading.ContentLoadManager"/>

Editor/Mono/BuildPipeline/BuildTargetDiscovery.bindings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public enum TargetAttributes
3131
IsConsole = (1 << 2),
3232
IsX64 = (1 << 3),
3333
IsStandalonePlatform = (1 << 4),
34-
DynamicBatchingDisabled = (1 << 5),
34+
// removed: DynamicBatchingDisabled = (1 << 5),
3535
CompressedGPUSkinningDisabled = (1 << 6),
3636
UseForsythOptimizedMeshData = (1 << 7),
3737
DisableEnlighten = (1 << 8),

Editor/Mono/BuildPipeline/Settings/BuildAssetBundleOptions.bindings.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ public enum BuildAssetBundleOptions
200200

201201
// Sprites are normally copied to all bundles that reference them. This flag prevents that behavior if the sprite is not in an atlas.
202202
///<summary>Use to prevent duplicating a texture when it is referenced in multiple bundles. This would primarily happen with particle systems. The new behavior does not duplicate the texture if the sprite does not belong to an atlas. Using this flag is the desired behavior, but is not set by default for backwards compatability reasons.</summary>
203-
StripUnatlasedSpriteCopies = 262144 // 1 << 18
203+
StripUnatlasedSpriteCopies = 262144, // 1 << 18
204+
205+
///<summary>Suppress the error reported when a LoadableObjectId or LoadableSceneId is encountered during an AssetBundle build.</summary>
206+
///<remarks>Use this when migrating between build pipeline backends when assets legitimately have Loadable references, but the same content is also built into AssetBundles. The references still resolve to null in the resulting bundle; this flag only silences the error log to keep the build usable.</remarks>
207+
SuppressLoadableErrors = 1048576 // 1 << 20
204208
}
205209
}

Editor/Mono/BuildPipeline/Settings/BuildContentDirectoryParameters.bindings.cs

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ namespace UnityEditor
2020
public struct BuildContentDirectoryParameters
2121
{
2222
/// <summary>
23-
/// Output path for the build.
23+
/// The output path for the content directory build.
2424
/// </summary>
2525
/// <remarks>
26-
/// This can be an absolute path, or a path relative to the current project. If the path does not exist
27-
/// <see cref="BuildPipeline.BuildContentDirectory"/> will attempt to create it.
26+
/// The path can be an absolute path, or a path relative to the project folder. If the path doesn't exist,
27+
/// <see cref="BuildPipeline.BuildContentDirectory"/> attempts to create it.
2828
/// </remarks>
2929
public string outputPath { get; set; }
3030

@@ -46,44 +46,16 @@ public struct BuildContentDirectoryParameters
4646
public BuildContentOptions options { get; set; }
4747

4848
/// <summary>
49-
/// Compression settings for the build. When not specified the value is <see cref="BuildCompression.Uncompressed"/>.
49+
/// The compression settings for the build. Defaults to <see cref="BuildCompression.Uncompressed"/>.
5050
/// </summary>
5151
public BuildCompression compression { get; set; }
5252

53-
/// <summary>
54-
/// The <see cref="BuildTarget"/> to build. (optional)
55-
/// </summary>
56-
/// <remarks>
57-
/// The output of the build is only compatible with the specific platform that it was built for, so you must produce
58-
/// different builds to use the assets on different platforms.
59-
///
60-
/// If targetPlatform is not specified, e.g. it is 0, then the targetPlatform and subtarget fields will all be determined
61-
/// from the current build settings.
62-
///
63-
/// It is strongly recommended to switch to the target platform prior to calling <see cref="BuildPipeline.BuildContentDirectory"/>,
64-
/// to ensure that the Editor assemblies have been compiled to match the target platform and a domain reload has been performed.
65-
/// BuildContentDirectory can build a different target platform than the one currently selected in the build settings, but it may not
66-
/// work as expected because platform-specific conditional compilation will be applied and some build callbacks may not execute the expected code.
67-
/// See the topic build-command-line in the Unity Manual for more details.
68-
/// </remarks>
69-
/// <seealso cref="EditorUserBuildSettings.activeBuildTarget"/>
70-
public BuildTarget targetPlatform { get; set; }
53+
// Internal: optional BuildTarget. When unset at default, native code takes both platform and subtarget from current Editor build settings.
54+
// Output is platform-specific. Building a non-active target can diverge from Editor conditional compilation and callbacks; prefer switching active target first (see Manual: build-command-line).
55+
internal BuildTarget targetPlatform { get; set; }
7156

72-
/// <summary>
73-
/// The subtarget to build. (optional)
74-
/// </summary>
75-
/// <remarks>
76-
/// For some BuildTargets the behaviour of a build can be influenced by using this field. The supported values are based on
77-
/// target-specific enums, for example <see cref="MobileTextureSubtarget"/>, <see cref="XboxBuildSubtarget"/>.
78-
///
79-
/// The subtarget can be assigned using the build settings UI. To build with the current build settings, the
80-
/// <see cref="BuildContentDirectoryParameters.targetPlatform"/> field should be left unassigned (e.g. with the value 0).
81-
/// </remarks>
82-
/// <seealso cref="EditorUserBuildSettings.standaloneBuildSubtarget"/>
83-
/// <seealso cref="EditorUserBuildSettings.androidBuildSubtarget"/>
84-
/// <seealso cref="EditorUserBuildSettings.webGLBuildSubtarget"/>
85-
/// <seealso cref="EditorUserBuildSettings.ps4BuildSubtarget"/>
86-
public int subtarget { get; set; }
57+
// Internal: optional subtarget for targets that support it (values from target-specific enums, e.g. MobileTextureSubtarget). Used with targetPlatform when that is explicitly set; otherwise follows active build settings (see EditorUserBuildSettings *BuildSubtarget).
58+
internal int subtarget { get; set; }
8759

8860
/// <summary>
8961
/// User-specified preprocessor defines used while compiling assemblies during the build. (optional)

Editor/Mono/BuildPipeline/Settings/BuildOptions.bindings.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ public enum BuildOptions
230230
///<summary>Will force the buildGUID to all zeros.</summary>
231231
NoUniqueIdentifier = 1 << 23,
232232

233+
///<summary>Suppress the error reported when a LoadableObjectId or LoadableSceneId is encountered during a Player build.</summary>
234+
///<remarks>Use this when migrating between build pipeline backends when assets legitimately have Loadable references, but the same content is also included in the Player. The references still resolve to null in the resulting build; this flag only silences the error log to keep the build usable.</remarks>
235+
SuppressLoadableErrors = 1 << 24,
236+
233237
// Wait for player connection on start
234238
///<summary>Sets the Player to wait for player connection on player start.</summary>
235239
///<seealso cref="Networking.PlayerConnection.PlayerConnection" />

Editor/Mono/BuildProfile/BuildProfileContext.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -893,32 +893,35 @@ static string GetActiveProfileDefaultQualityLevel()
893893
}
894894

895895
[RequiredByNativeCode, UsedImplicitly]
896-
static bool SetActiveShaderBuildSettings(ShaderBuildSettings.KeywordDeclarationOverride[] keywordDeclarationOverrides, string[] defines)
896+
static bool SetActiveShaderBuildSettings(ShaderBuildSettings.KeywordDeclarationOverride[] keywordDeclarationOverrides, string[] defines, ShaderBuildSettings.ShaderCompilerSettings[] compilerSettings)
897897
{
898898
if (!ActiveProfileHasGraphicsSettings())
899899
return false;
900900

901901
activeProfile.graphicsSettings.shaderBuildSettings = new ShaderBuildSettings
902902
{
903903
keywordDeclarationOverrides = keywordDeclarationOverrides,
904-
defines = defines
904+
defines = defines,
905+
compilerSettings = compilerSettings
905906
};
906907
return true;
907908
}
908909

909910
[RequiredByNativeCode, UsedImplicitly]
910-
static void GetActiveShaderBuildSettings(out ShaderBuildSettings.KeywordDeclarationOverride[] keywordDeclarationOverrides, out string[] defines)
911+
static void GetActiveShaderBuildSettings(out ShaderBuildSettings.KeywordDeclarationOverride[] keywordDeclarationOverrides, out string[] defines, out ShaderBuildSettings.ShaderCompilerSettings[] compilerSettings)
911912
{
912913
if (!ActiveProfileHasGraphicsSettings())
913914
{
914915
keywordDeclarationOverrides = null;
915916
defines = null;
917+
compilerSettings = null;
916918
return;
917919
}
918920

919921
var shaderBuildSettings = activeProfile.graphicsSettings.shaderBuildSettings;
920922
keywordDeclarationOverrides = shaderBuildSettings.keywordDeclarationOverrides;
921923
defines = shaderBuildSettings.defines;
924+
compilerSettings = shaderBuildSettings.compilerSettings;
922925
}
923926

924927
[RequiredByNativeCode]

0 commit comments

Comments
 (0)