Skip to content

Commit a935c76

Browse files
author
Unity Technologies
committed
Unity 2023.1.0a24 C# reference source code
1 parent 9436b69 commit a935c76

File tree

231 files changed

+2240
-935
lines changed

Some content is hidden

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

231 files changed

+2240
-935
lines changed

Editor/Mono/GI/LightmapParameters.bindings.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,13 @@ public float edgeStitching
6161
get { return stitchEdges ? 1.0f : 0.0f; }
6262
set { stitchEdges = (value != 0.0f); }
6363
}
64+
65+
[NativeHeader("Runtime/Graphics/LightmapEnums.h")]
66+
public enum AntiAliasingSamples
67+
{
68+
SSAA1 = 1,
69+
SSAA4 = 2,
70+
SSAA16 = 4,
71+
}
6472
}
6573
}

Editor/Mono/GI/Lightmapping.bindings.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,6 @@ internal static FilterMode filterMode
245245
[FreeFunction]
246246
internal static extern MemLabels GetMaterialTexturesMemLabels();
247247

248-
[FreeFunction]
249-
internal static extern MemLabels GetNotShownMemLabels();
250-
251248
[StaticAccessor("PVRMemoryLabelTracker::Get()", StaticAccessorType.Arrow)]
252249
internal static extern void ResetExplicitlyShownMemLabels();
253250

@@ -264,9 +261,6 @@ internal static FilterMode filterMode
264261
[StaticAccessor("BakedGISceneManager::Get()", StaticAccessorType.Arrow)]
265262
internal static extern void LogGPUMemoryStatistics();
266263

267-
[StaticAccessor("BakedGISceneManager::Get()", StaticAccessorType.Arrow)]
268-
internal static extern float GetLightmapBakeTimeRaw();
269-
270264
[StaticAccessor("BakedGISceneManager::Get()", StaticAccessorType.Arrow)]
271265
internal static extern float GetLightmapBakeTimeTotal();
272266

Editor/Mono/GUI/PackageImport.cs

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,14 @@ void BottomArea()
244244
{
245245
PackageImportWizard.instance.CancelImport();
246246
}
247-
if (PackageImportWizard.instance.IsProjectSettingStep && GUILayout.Button(EditorGUIUtility.TrTextContent("Back")))
247+
248+
var isSecondStep = PackageImportWizard.instance.IsMultiStepWizard &&
249+
PackageImportWizard.instance.IsProjectSettingStep;
250+
if (isSecondStep && GUILayout.Button(EditorGUIUtility.TrTextContent("Back")))
248251
{
249252
PackageImportWizard.instance.DoPreviousStep(m_ImportPackageItems);
250253
}
251-
var buttonText = PackageImportWizard.instance.IsMultiStepWizard
252-
&& !PackageImportWizard.instance.IsProjectSettingStep ? "Next" : "Import";
254+
var buttonText = isSecondStep || !PackageImportWizard.instance.IsMultiStepWizard ? "Import" : "Next";
253255
if (GUILayout.Button(EditorGUIUtility.TrTextContent(buttonText)))
254256
{
255257
if (m_ImportPackageItems != null)
@@ -440,8 +442,14 @@ public void StartImport(string packagePath, ImportPackageItem[] items, string pa
440442
m_AssetContentItems.Add(item);
441443
}
442444

443-
m_IsMultiStepWizard = m_ProjectSettingItems.Any();
444-
ShowImportWindow(m_AssetContentItems.ToArray());
445+
m_IsMultiStepWizard = m_AssetContentItems.Any() && m_ProjectSettingItems.Any();
446+
if (m_AssetContentItems.Any())
447+
ShowImportWindow(m_AssetContentItems.ToArray());
448+
else if (m_ProjectSettingItems.Any())
449+
{
450+
m_IsProjectSettingStep = true;
451+
ShowImportWindow(m_ProjectSettingItems.ToArray());
452+
}
445453
}
446454

447455
public void DoNextStep(ImportPackageItem[] importPackageItems)
@@ -463,12 +471,12 @@ public void DoNextStep(ImportPackageItem[] importPackageItems)
463471

464472
public void DoPreviousStep(ImportPackageItem[] importPackageItems)
465473
{
466-
if (IsProjectSettingStep)
467-
{
468-
m_ProjectSettingItems = new List<ImportPackageItem>(importPackageItems);
469-
m_IsProjectSettingStep = false;
470-
ShowImportWindow(m_AssetContentItems.ToArray());
471-
}
474+
if (!IsProjectSettingStep || !IsMultiStepWizard)
475+
return;
476+
477+
m_ProjectSettingItems = new List<ImportPackageItem>(importPackageItems);
478+
m_IsProjectSettingStep = false;
479+
ShowImportWindow(m_AssetContentItems.ToArray());
472480
}
473481

474482
public void CancelImport()
@@ -495,8 +503,7 @@ private void ShowImportWindow(ImportPackageItem[] items)
495503

496504
private void FinishImport()
497505
{
498-
var completeItemList = IsMultiStepWizard ? m_AssetContentItems.Concat(m_ProjectSettingItems) : m_AssetContentItems;
499-
PackageUtility.ImportPackageAssetsWithOrigin(m_AssetOrigin, completeItemList.ToArray());
506+
PackageUtility.ImportPackageAssetsWithOrigin(m_AssetOrigin, m_AssetContentItems.Concat(m_ProjectSettingItems).ToArray());
500507
CloseImportWindow();
501508
}
502509

Editor/Mono/Inspector/Enlighten/LightmapParameters.cs

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using UnityEngine;
66
using UnityEditor;
77
using UnityEngine.Rendering;
8+
using System;
89

910
namespace UnityEditor
1011
{
@@ -91,7 +92,25 @@ public override void OnInspectorGUI()
9192
if (m_BakedGISettings.value)
9293
{
9394
EditorGUI.indentLevel++;
94-
EditorGUILayout.PropertyField(m_AntiAliasingSamples, Styles.antiAliasingSamplesContent);
95+
if (m_AntiAliasingSamples.hasMultipleDifferentValues)
96+
{
97+
EditorGUI.BeginChangeCheck();
98+
EditorGUI.showMixedValue = true;
99+
100+
int fieldValue = EditorGUILayout.IntPopup(Styles.antiAliasingSamplesContent, m_AntiAliasingSamples.intValue, Styles.antiAliasingSamplesStrings, Styles.antiAliasingSampleValues);
101+
102+
if (EditorGUI.EndChangeCheck())
103+
m_AntiAliasingSamples.intValue = fieldValue;
104+
105+
EditorGUI.showMixedValue = false;
106+
}
107+
108+
else
109+
{
110+
int fieldValue = EditorGUILayout.IntPopup(Styles.antiAliasingSamplesContent, m_AntiAliasingSamples.intValue, Styles.antiAliasingSamplesStrings, Styles.antiAliasingSampleValues);
111+
m_AntiAliasingSamples.intValue = fieldValue;
112+
}
113+
95114
const float minPushOff = 0.0001f; // Keep in sync with PLM_MIN_PUSHOFF
96115
EditorGUILayout.Slider(m_Pushoff, minPushOff, 1.0f, Styles.pushoffContent);
97116
EditorGUILayout.PropertyField(m_BakedLightmapTag, Styles.bakedLightmapTagContent);
@@ -124,6 +143,14 @@ internal override void OnHeaderControlsGUI()
124143

125144
private class Styles
126145
{
146+
public static readonly int[] antiAliasingSampleValues = (int[]) Enum.GetValues(typeof(LightmapParameters.AntiAliasingSamples));
147+
public static readonly GUIContent[] antiAliasingSamplesStrings =
148+
{
149+
EditorGUIUtility.TrTextContent("1"),
150+
EditorGUIUtility.TrTextContent("4"),
151+
EditorGUIUtility.TrTextContent("16")
152+
};
153+
127154
public static readonly GUIContent generalGIContent = EditorGUIUtility.TrTextContent("General Parameters", "Settings used in both Precomputed Realtime Global Illumination and Baked Global Illumination.");
128155
public static readonly GUIContent precomputedRealtimeGIContent = EditorGUIUtility.TrTextContent("Realtime Global Illumination", "Settings used in Precomputed Realtime Global Illumination where it is precomputed how indirect light can bounce between static objects, but the final lighting is done at runtime. Lights, ambient lighting in addition to the materials and emission of static objects can still be changed at runtime. Only static objects can affect GI by blocking and bouncing light, but non-static objects can receive bounced light via light probes."); // Reuse the label from the Lighting window
129156
public static readonly GUIContent resolutionContent = EditorGUIUtility.TrTextContent("Resolution", "Realtime lightmap resolution in texels per world unit. This value is multiplied by the realtime resolution in the Lighting window to give the output lightmap resolution. This should generally be an order of magnitude less than what is common for baked lightmaps to keep the precompute time manageable and the performance at runtime acceptable. Note that if this is made more fine-grained, then the Irradiance Budget will often need to be increased too, to fully take advantage of this increased detail.");
@@ -135,16 +162,12 @@ private class Styles
135162
public static readonly GUIContent edgeStitchingContent = EditorGUIUtility.TrTextContent("Edge Stitching", "If enabled, ensures that UV charts (aka UV islands) in the generated lightmaps blend together where they meet so there is no visible seam between them.");
136163
public static readonly GUIContent systemTagContent = EditorGUIUtility.TrTextContent("System Tag", "Systems are groups of objects whose lightmaps are in the same atlas. It is also the granularity at which dependencies are calculated. Multiple systems are created automatically if the scene is big enough, but it can be helpful to be able to split them up manually for e.g. streaming in sections of a level. The system tag lets you force an object into a different realtime system even though all the other parameters are the same.");
137164
public static readonly GUIContent bakedGIContent = EditorGUIUtility.TrTextContent("Baked Global Illumination", "Settings used in Baked Global Illumination where direct and indirect lighting for static objects is precalculated and saved (baked) into lightmaps for use at runtime. This is useful when lights are known to be static, for mobile, for low end devices and other situations where there is not enough processing power to use Precomputed Realtime GI. You can toggle on each light whether it should be included in the bake."); // Reuse the label from the Lighting window
138-
public static readonly GUIContent antiAliasingSamplesContent = EditorGUIUtility.TrTextContent("Anti-aliasing Samples", "The maximum number of times to supersample a texel to reduce aliasing. Progressive lightmapper supersamples the positions and normals buffers (part of the G-buffer) and hence the sample count is a multiplier on the amount of memory used for those buffers. Progressive lightmapper clamps the value to the [1;16] range.");
165+
public static readonly GUIContent antiAliasingSamplesContent = EditorGUIUtility.TrTextContent("Anti-aliasing Samples", "How many samples to use when antialiasing lightmap texels. Ray positions and normals buffers are also increased in size by this value. Higher values improve lightmap quality but also multiply memory usage when baking. A value of 1 disables supersampling.");
139166
public static readonly GUIContent isTransparent = EditorGUIUtility.TrTextContent("Is Transparent", "If enabled, the object appears transparent during GlobalIllumination lighting calculations. Backfaces are not contributing to and light travels through the surface. This is useful for emissive invisible surfaces.");
140167
public static readonly GUIContent pushoffContent = EditorGUIUtility.TrTextContent("Pushoff", "The amount to push off geometry for ray tracing, in modelling units. It is applied to all baked light maps, so it will affect direct light, indirect light and AO. Useful for getting rid of unwanted AO or shadowing.");
141168
public static readonly GUIContent bakedLightmapTagContent = EditorGUIUtility.TrTextContent("Baked Tag", "An integer that lets you force an object into a different baked lightmap even though all the other parameters are the same. This can be useful e.g. when streaming in sections of a level.");
142169
public static readonly GUIContent limitLightmapCount = EditorGUIUtility.TrTextContent("Limit Lightmap Count", "If enabled, objects with the same baked GI settings will be packed into a specified number of lightmaps. This may reduce the objects' lightmap resolution.");
143170
public static readonly GUIContent lightmapMaxCount = EditorGUIUtility.TrTextContent("Max Lightmaps", "The maximum number of lightmaps into which objects will be packed.");
144-
145-
public static readonly GUIContent generalLabel = EditorGUIUtility.TrTextContent("General");
146-
public static readonly GUIContent progressiveLabel = EditorGUIUtility.TrTextContent("Progressive Lightmapper");
147-
public static readonly GUIContent enlightenLabel = EditorGUIUtility.TrTextContent("Enlighten");
148171
}
149172
}
150173
}

Editor/Mono/Inspector/LightingSettingsEditor.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ internal class SharedLightingSettingsEditor
9999
SerializedProperty m_ForceWhiteAlbedo;
100100
SerializedProperty m_ForceUpdates;
101101
SerializedProperty m_FilterMode;
102-
SerializedProperty m_TiledBaking;
103-
SerializedProperty m_NumRaysToShootPerTexel;
104102
SerializedProperty m_RespectSceneVisibilityWhenBakingGI;
105103

106104
enum DenoiserTarget
@@ -338,8 +336,6 @@ public void UpdateSettings(SerializedObject lightingSettingsObject)
338336
m_ForceUpdates = lightingSettingsObject.FindProperty("m_ForceUpdates");
339337
m_FilterMode = lightingSettingsObject.FindProperty("m_FilterMode");
340338
m_BounceScale = lightingSettingsObject.FindProperty("m_BounceScale");
341-
m_TiledBaking = lightingSettingsObject.FindProperty("m_PVRTiledBaking");
342-
m_NumRaysToShootPerTexel = lightingSettingsObject.FindProperty("m_NumRaysToShootPerTexel");
343339
m_RespectSceneVisibilityWhenBakingGI = lightingSettingsObject.FindProperty("m_RespectSceneVisibilityWhenBakingGI");
344340
}
345341

@@ -511,7 +507,11 @@ void GeneralLightmapSettingsGUI(bool compact)
511507
{
512508
EditorGUI.indentLevel++;
513509

514-
EditorGUILayout.PropertyField(m_PVRCulling, Styles.culling);
510+
bool iterative = m_GIWorkflowMode.intValue == (int)Lightmapping.GIWorkflowMode.Iterative;
511+
if (iterative)
512+
{
513+
EditorGUILayout.PropertyField(m_PVRCulling, Styles.culling);
514+
}
515515
EditorGUILayout.PropertyField(m_PVREnvironmentIS, Styles.environmentImportanceSampling);
516516

517517
MultiEditableDelayedIntField(m_PVRDirectSampleCount, Styles.directSampleCount);

Editor/Mono/PlayerSettings.deprecated.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
using System;
66
using UnityEngine;
7+
using UnityEngine.Bindings;
78

89
using EditorGraphicsSettings = UnityEditor.Rendering.EditorGraphicsSettings;
910

@@ -167,6 +168,15 @@ public static AndroidTargetDevice targetDevice
167168

168169
[Obsolete("minifyWithR8 is obsolete and has no effect anymore, since Android Gradle Plugin 7.0 always uses R8", false)]
169170
public static bool minifyWithR8 { get { return true; } set {} }
171+
172+
[Obsolete("Renamed to match UI. Please use splitApplicationBinary instead. (UnityUpgradable) -> splitApplicationBinary", false)]
173+
public static extern bool useAPKExpansionFiles
174+
{
175+
[NativeMethod("GetAndroidSplitApplicationBinary")]
176+
get;
177+
[NativeMethod("SetAndroidSplitApplicationBinary")]
178+
set;
179+
}
170180
}
171181

172182
partial class iOS

Editor/Mono/PlayerSettingsAndroid.bindings.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,13 @@ public static extern bool licenseVerification
466466
[NativeMethod("GetAndroidLicenseVerification")]
467467
get;
468468
}
469-
470-
// Use APK Expansion Files
471-
public static extern bool useAPKExpansionFiles { get; set; }
469+
public static extern bool splitApplicationBinary
470+
{
471+
[NativeMethod("GetAndroidSplitApplicationBinary")]
472+
get;
473+
[NativeMethod("SetAndroidSplitApplicationBinary")]
474+
set;
475+
}
472476

473477
// Application should show ActivityIndicator when loading
474478
public static extern AndroidShowActivityIndicatorOnLoading showActivityIndicatorOnLoading

0 commit comments

Comments
 (0)