Skip to content

Commit cf05456

Browse files
author
Unity Technologies
committed
Unity 2023.2.0a7 C# reference source code
1 parent dd0d959 commit cf05456

File tree

52 files changed

+1076
-491
lines changed

Some content is hidden

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

52 files changed

+1076
-491
lines changed

Editor/Mono/AssetDatabase/AssetDatabase.deprecated.cs

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ namespace UnityEditor
1313
partial class AssetDatabase
1414
{
1515
// Gets the path to the text .meta file associated with an asset
16-
[Obsolete("GetTextMetaDataPathFromAssetPath has been renamed to GetTextMetaFilePathFromAssetPath (UnityUpgradable) -> GetTextMetaFilePathFromAssetPath(*)")]
16+
[Obsolete("GetTextMetaDataPathFromAssetPath has been renamed to GetTextMetaFilePathFromAssetPath (UnityUpgradable) -> GetTextMetaFilePathFromAssetPath(*)",true)]
1717
public static string GetTextMetaDataPathFromAssetPath(string path) { return null; }
1818
}
1919

2020
// Used to be part of Asset Server, and public API for some reason.
21-
[Obsolete("AssetStatus enum is not used anymore (Asset Server has been removed)")]
21+
[Obsolete("AssetStatus enum is not used anymore (Asset Server has been removed)",true)]
2222
public enum AssetStatus
2323
{
2424
Calculating = -1,
@@ -35,7 +35,7 @@ public enum AssetStatus
3535
}
3636

3737
// Used to be part of Asset Server, and public API for some reason.
38-
[Obsolete("AssetsItem class is not used anymore (Asset Server has been removed)")]
38+
[Obsolete("AssetsItem class is not used anymore (Asset Server has been removed)",true)]
3939
[StructLayout(LayoutKind.Sequential)]
4040
[System.Serializable]
4141
public sealed class AssetsItem
@@ -58,11 +58,11 @@ namespace UnityEditor.Experimental
5858
public partial class AssetDatabaseExperimental
5959
{
6060
[FreeFunction("AssetDatabase::ClearImporterOverride")]
61-
[Obsolete("AssetDatabaseExperimental.ClearImporterOverride() has been deprecated. Use AssetDatabase.ClearImporterOverride() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.ClearImporterOverride(*)", false)]
61+
[Obsolete("AssetDatabaseExperimental.ClearImporterOverride() has been deprecated. Use AssetDatabase.ClearImporterOverride() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.ClearImporterOverride(*)", true)]
6262
extern public static void ClearImporterOverride(string path);
6363

6464
[FreeFunction("AssetDatabase::IsCacheServerEnabled")]
65-
[Obsolete("AssetDatabaseExperimental.IsCacheServerEnabled() has been deprecated. Use AssetDatabase.IsCacheServerEnabled() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.IsCacheServerEnabled(*)", false)]
65+
[Obsolete("AssetDatabaseExperimental.IsCacheServerEnabled() has been deprecated. Use AssetDatabase.IsCacheServerEnabled() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.IsCacheServerEnabled(*)", true)]
6666
public extern static bool IsCacheServerEnabled();
6767

6868
[Obsolete("AssetDatabaseExperimental.SetImporterOverride<T>() has been deprecated. Use AssetDatabase.SetImporterOverride<T>() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.SetImporterOverride<T>(*)", true)]
@@ -81,70 +81,64 @@ public static void SetImporterOverride<T>(string path)
8181
extern public static Type[] GetAvailableImporterTypes(string path);
8282

8383
[FreeFunction("AcceleratorClientCanConnectTo")]
84-
[Obsolete("AssetDatabaseExperimental.CanConnectToCacheServer() has been deprecated. Use AssetDatabase.CanConnectToCacheServer() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.CanConnectToCacheServer(*)", false)]
84+
[Obsolete("AssetDatabaseExperimental.CanConnectToCacheServer() has been deprecated. Use AssetDatabase.CanConnectToCacheServer() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.CanConnectToCacheServer(*)", true)]
8585
public extern static bool CanConnectToCacheServer(string ip, UInt16 port);
8686

8787
[FreeFunction()]
88-
[Obsolete("AssetDatabaseExperimental.RefreshSettings() has been deprecated. Use AssetDatabase.RefreshSettings() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.RefreshSettings(*)", false)]
88+
[Obsolete("AssetDatabaseExperimental.RefreshSettings() has been deprecated. Use AssetDatabase.RefreshSettings() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.RefreshSettings(*)", true)]
8989
public extern static void RefreshSettings();
9090

91-
[Obsolete("AssetDatabaseExperimental.CacheServerConnectionChangedParameters has been deprecated. Use UnityEditor.CacheServerConnectionChangedParameters instead (UnityUpgradable) -> UnityEditor.CacheServerConnectionChangedParameters", false)]
91+
[Obsolete("AssetDatabaseExperimental.CacheServerConnectionChangedParameters has been deprecated. Use UnityEditor.CacheServerConnectionChangedParameters instead (UnityUpgradable) -> UnityEditor.CacheServerConnectionChangedParameters", true)]
9292
public struct CacheServerConnectionChangedParameters
9393
{
9494
}
9595

9696
#pragma warning disable 67
97-
[Obsolete("AssetDatabaseExperimental.cacheServerConnectionChanged has been deprecated. Use AssetDatabase.cacheServerConnectionChanged instead (UnityUpgradable) -> UnityEditor.AssetDatabase.cacheServerConnectionChanged", false)]
97+
[Obsolete("AssetDatabaseExperimental.cacheServerConnectionChanged has been deprecated. Use AssetDatabase.cacheServerConnectionChanged instead (UnityUpgradable) -> UnityEditor.AssetDatabase.cacheServerConnectionChanged", true)]
9898
public static event Action<CacheServerConnectionChangedParameters> cacheServerConnectionChanged;
9999
#pragma warning restore 67
100100

101101
[FreeFunction("AcceleratorClientIsConnected")]
102-
[Obsolete("AssetDatabaseExperimental.IsConnectedToCacheServer() has been deprecated. Use AssetDatabase.IsConnectedToCacheServer() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.IsConnectedToCacheServer(*)", false)]
102+
[Obsolete("AssetDatabaseExperimental.IsConnectedToCacheServer() has been deprecated. Use AssetDatabase.IsConnectedToCacheServer() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.IsConnectedToCacheServer(*)", true)]
103103
public extern static bool IsConnectedToCacheServer();
104104

105105
[FreeFunction()]
106-
[Obsolete("AssetDatabaseExperimental.GetCacheServerAddress() has been deprecated. Use AssetDatabase.GetCacheServerAddress() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerAddress(*)", false)]
106+
[Obsolete("AssetDatabaseExperimental.GetCacheServerAddress() has been deprecated. Use AssetDatabase.GetCacheServerAddress() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerAddress(*)", true)]
107107
public extern static string GetCacheServerAddress();
108108

109109
[FreeFunction()]
110-
[Obsolete("AssetDatabaseExperimental.GetCacheServerPort() has been deprecated. Use AssetDatabase.GetCacheServerPort() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerPort(*)", false)]
110+
[Obsolete("AssetDatabaseExperimental.GetCacheServerPort() has been deprecated. Use AssetDatabase.GetCacheServerPort() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerPort(*)", true)]
111111
public extern static UInt16 GetCacheServerPort();
112112

113113
[FreeFunction("AssetDatabase::GetCacheServerNamespacePrefix")]
114-
[Obsolete("AssetDatabaseExperimental.GetCacheServerNamespacePrefix() has been deprecated. Use AssetDatabase.GetCacheServerNamespacePrefix() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerNamespacePrefix(*)", false)]
114+
[Obsolete("AssetDatabaseExperimental.GetCacheServerNamespacePrefix() has been deprecated. Use AssetDatabase.GetCacheServerNamespacePrefix() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerNamespacePrefix(*)", true)]
115115
public extern static string GetCacheServerNamespacePrefix();
116116

117117
[FreeFunction("AssetDatabase::GetCacheServerEnableDownload")]
118-
[Obsolete("AssetDatabaseExperimental.GetCacheServerEnableDownload() has been deprecated. Use AssetDatabase.GetCacheServerEnableDownload() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerEnableDownload(*)", false)]
118+
[Obsolete("AssetDatabaseExperimental.GetCacheServerEnableDownload() has been deprecated. Use AssetDatabase.GetCacheServerEnableDownload() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerEnableDownload(*)", true)]
119119
public extern static bool GetCacheServerEnableDownload();
120120

121121
[FreeFunction("AssetDatabase::GetCacheServerEnableUpload")]
122-
[Obsolete("AssetDatabaseExperimental.GetCacheServerEnableUpload() has been deprecated. Use AssetDatabase.GetCacheServerEnableUpload() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerEnableUpload(*)", false)]
122+
[Obsolete("AssetDatabaseExperimental.GetCacheServerEnableUpload() has been deprecated. Use AssetDatabase.GetCacheServerEnableUpload() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerEnableUpload(*)", true)]
123123
public extern static bool GetCacheServerEnableUpload();
124124

125125
[FreeFunction("AssetDatabase::IsDirectoryMonitoringEnabled")]
126-
[Obsolete("AssetDatabaseExperimental.IsDirectoryMonitoringEnabled() has been deprecated. Use AssetDatabase.IsDirectoryMonitoringEnabled() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.IsDirectoryMonitoringEnabled(*)", false)]
126+
[Obsolete("AssetDatabaseExperimental.IsDirectoryMonitoringEnabled() has been deprecated. Use AssetDatabase.IsDirectoryMonitoringEnabled() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.IsDirectoryMonitoringEnabled(*)", true)]
127127
public extern static bool IsDirectoryMonitoringEnabled();
128128

129129
[FreeFunction("AssetDatabaseExperimental::RegisterCustomDependency")]
130130
[PreventExecutionInState(AssetDatabasePreventExecution.kPreventCustomDependencyChanges, PreventExecutionSeverity.PreventExecution_ManagedException, "Custom dependencies can only be removed when the assetdatabase is not importing.")]
131-
[Obsolete("AssetDatabaseExperimental.RegisterCustomDependency() has been deprecated. Use AssetDatabase.RegisterCustomDependency() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.RegisterCustomDependency(*)", false)]
131+
[Obsolete("AssetDatabaseExperimental.RegisterCustomDependency() has been deprecated. Use AssetDatabase.RegisterCustomDependency() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.RegisterCustomDependency(*)", true)]
132132
public extern static void RegisterCustomDependency(string dependency, Hash128 hashOfValue);
133133

134134
[FreeFunction("AssetDatabaseExperimental::UnregisterCustomDependencyPrefixFilter")]
135135
[PreventExecutionInState(AssetDatabasePreventExecution.kPreventCustomDependencyChanges, PreventExecutionSeverity.PreventExecution_ManagedException, "Custom dependencies can only be removed when the assetdatabase is not importing.")]
136-
[Obsolete("AssetDatabaseExperimental.UnregisterCustomDependencyPrefixFilter() has been deprecated. Use AssetDatabase.UnregisterCustomDependencyPrefixFilter() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.UnregisterCustomDependencyPrefixFilter(*)", false)]
136+
[Obsolete("AssetDatabaseExperimental.UnregisterCustomDependencyPrefixFilter() has been deprecated. Use AssetDatabase.UnregisterCustomDependencyPrefixFilter() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.UnregisterCustomDependencyPrefixFilter(*)", true)]
137137
public extern static UInt32 UnregisterCustomDependencyPrefixFilter(string prefixFilter);
138138

139139
[FreeFunction("AssetDatabase::IsAssetImportProcess")]
140-
[Obsolete("AssetDatabaseExperimental.IsAssetImportWorkerProcess() has been deprecated. Use AssetDatabase.IsAssetImportWorkerProcess() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.IsAssetImportWorkerProcess(*)", false)]
140+
[Obsolete("AssetDatabaseExperimental.IsAssetImportWorkerProcess() has been deprecated. Use AssetDatabase.IsAssetImportWorkerProcess() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.IsAssetImportWorkerProcess(*)", true)]
141141
public extern static bool IsAssetImportWorkerProcess();
142-
143-
[Obsolete("Has been replaced by AssetDatabaseExperimental.RefreshSettings", true)]
144-
public static void ReconnectToCacheServer()
145-
{
146-
throw new NotSupportedException("Please use AssetdatabaseExperimental.RefreshSettings instead.");
147-
}
148142
}
149143
}
150144

Editor/Mono/EditorGUI.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ private enum DragCandidateState
129129
internal const int kInspTitlebarFoldoutIconWidth = 13;
130130
internal static readonly SVC<float> kWindowToolbarHeight = new SVC<float>("--window-toolbar-height", 21f);
131131
internal const int kTabButtonHeight = 22;
132+
internal const int kLargeButtonHeight = 24;
132133
private const string kEnabledPropertyName = "m_Enabled";
133134
private const string k_MultiEditValueString = "<>";
134135
private const float kDropDownArrowMargin = 2;
@@ -7469,6 +7470,7 @@ internal static bool DefaultPropertyField(Rect position, SerializedProperty prop
74697470
// Should we inline? All one-line vars as well as Vector2, Vector3, Rect and Bounds properties are inlined.
74707471
if (!HasVisibleChildFields(property))
74717472
{
7473+
bool canUseExpression = ConstrainProportionsTransformScale.CanUseMathExpressions(property);
74727474
switch (type)
74737475
{
74747476
case SerializedPropertyType.Integer:
@@ -7488,7 +7490,8 @@ internal static bool DefaultPropertyField(Rect position, SerializedProperty prop
74887490
for (var i = 0; i < values.Length; ++i)
74897491
{
74907492
values[i] = originalValues[i];
7491-
val.expression.Evaluate(ref values[i], i, values.Length);
7493+
if(canUseExpression)
7494+
val.expression.Evaluate(ref values[i], i, values.Length);
74927495
}
74937496
property.allLongValues = values;
74947497
}
@@ -7525,7 +7528,7 @@ internal static bool DefaultPropertyField(Rect position, SerializedProperty prop
75257528
for (var i = 0; i < values.Length; ++i)
75267529
{
75277530
values[i] = originalValues[i];
7528-
if (val.expression.Evaluate(ref values[i], i, values.Length))
7531+
if (canUseExpression && val.expression.Evaluate(ref values[i], i, values.Length))
75297532
{
75307533
if (isFloat)
75317534
values[i] = MathUtils.ClampToFloat(values[i]);

Editor/Mono/GI/LightBaker.bindings.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ public struct ProbeRequest
9494
public UInt64 positionLength;
9595
public float pushoff;
9696
public string outputFolderPath;
97+
98+
// Environment occlusion
99+
public UInt64 integrationRadiusOffset;
100+
public UInt32 environmentOcclusionSampleCount;
101+
public bool ignoreDirectEnvironment;
97102
};
98103
[Flags]
99104
public enum LightmapRequestOutputType : UInt32
@@ -549,12 +554,20 @@ public void SetProbePositions(Vector3[] positions)
549554
}
550555
public extern void SetProbePositions(ReadOnlySpan<Vector3> positions);
551556

557+
public void SetIntegrationRadii(float[] positions)
558+
{
559+
SetIntegrationRadii(positions.AsSpan());
560+
}
561+
public extern void SetIntegrationRadii(ReadOnlySpan<float> positions);
562+
552563
public extern Vector3[] GetProbePositions();
564+
public extern float[] GetIntegrationRadii();
553565

554566
internal static class BindingsMarshaller
555567
{
556568
public static IntPtr ConvertToNative(BakeInput bakeInput) => bakeInput.m_Ptr;
557569
}
570+
public extern bool CheckIntegrity();
558571
}
559572

560573
[StructLayout(LayoutKind.Sequential)]

0 commit comments

Comments
 (0)