Skip to content

Commit ba35550

Browse files
author
Unity Technologies
committed
Unity 2021.3.51f1 C# reference source code
1 parent e2bad74 commit ba35550

7 files changed

Lines changed: 64 additions & 21 deletions

File tree

Editor/Mono/PlayerSettingsAndroid.bindings.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ public enum AndroidSdkVersions
110110

111111
// Android 15.0, API level 35
112112
AndroidApiLevel35 = 35,
113+
114+
// Android 16.0, API level 36
115+
AndroidApiLevel36 = 36,
113116
}
114117

115118
// Preferred application install location
@@ -568,6 +571,10 @@ public static extern bool optimizedFramePacing
568571
[NativeMethod("SetAndroidUseSwappy")]
569572
set;
570573
}
574+
575+
// Add enableOnBackInvokedCallback flag to AndroidManifest
576+
[NativeProperty("AndroidPredictiveBackSupport", TargetType.Function)]
577+
public static extern bool predictiveBackSupport { get; set; }
571578
}
572579
}
573580
}

Editor/Mono/SceneModeWindows/DefaultLightingExplorerExtension.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,9 @@ protected virtual LightingExplorerTableColumn[] GetEmissivesColumns()
471471
if (EditorGUI.EndChangeCheck())
472472
{
473473
Material material = (Material)prop.serializedObject.targetObject;
474+
Undo.RecordObject(material, $"Modify Emission Flags of {material.name}");
474475
material.globalIlluminationFlags = giFlags;
476+
EditorUtility.SetDirty(material);
475477

476478
prop.serializedObject.Update();
477479
}
@@ -495,7 +497,9 @@ protected virtual LightingExplorerTableColumn[] GetEmissivesColumns()
495497

496498
if (EditorGUI.EndChangeCheck())
497499
{
500+
Undo.RecordObject(material, $"Modify Emission Flags of {material.name}");
498501
material.SetColor("_EmissionColor", newValue);
502+
EditorUtility.SetDirty(material);
499503
}
500504
EditorGUI.EndProperty();
501505
}
@@ -511,7 +515,9 @@ protected virtual LightingExplorerTableColumn[] GetEmissivesColumns()
511515
Color color = sourceMaterial.GetColor("_EmissionColor");
512516

513517
Material targetMaterial = (Material)target.serializedObject.targetObject;
518+
Undo.RecordObject(targetMaterial, $"Modify Emission Flags of {targetMaterial.name}");
514519
targetMaterial.SetColor("_EmissionColor", color);
520+
EditorUtility.SetDirty(targetMaterial);
515521
}) // 3: Color
516522
};
517523
}

Editor/Mono/Scripting/Compilers/UWPReferences.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,22 @@ public UWPExtension(string manifest, string windowsKitsFolder, string sdkVersion
7777
private static readonly UWPSDK kMinimumSupportedUWPSDK = new UWPSDK(kMinimumSupportedUWPVersion, new Version(14, 0), new[] { kMinimumSupportedPreviousUWPSDK });
7878

7979
public static UWPSDK MinimumSupportedUWPSDK { get { return kMinimumSupportedUWPSDK; } }
80+
public static string GetBinPath(UWPSDK sdk, string architecture)
81+
{
82+
83+
var folder = GetWindowsKit10();
84+
if (string.IsNullOrEmpty(folder))
85+
return null;
86+
87+
var version = SdkVersionToString(sdk.Version);
88+
89+
var binPath = CombinePaths(folder, "bin", version, architecture);
90+
91+
if(!Directory.Exists(binPath))
92+
return null;
93+
94+
return binPath;
95+
}
8096

8197
public static string[] GetReferences(UWPSDK sdk)
8298
{

External/unitytls/builds/CSharp/BindingsUnity/TLSAgent.gen.bindings.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,21 @@ internal static unsafe partial class Binding
8181
public const int UNITYTLS_SSL_HANDSHAKE_SERVER_FINISHED = 13;
8282
public const int UNITYTLS_SSL_HANDSHAKE_FLUSH_BUFFERS = 14;
8383
public const int UNITYTLS_SSL_HANDSHAKE_WRAPUP = 15;
84-
public const int UNITYTLS_SSL_HANDSHAKE_OVER = 16;
85-
public const int UNITYTLS_SSL_HANDSHAKE_SERVER_NEW_SESSION_TICKET = 17;
86-
public const int UNITYTLS_SSL_HANDSHAKE_HELLO_VERIFY_REQUIRED = 18;
84+
public const int UNITYTLS_SSL_HANDSHAKE_OVER = 27;
85+
public const int UNITYTLS_SSL_HANDSHAKE_SERVER_NEW_SESSION_TICKET = 16;
86+
public const int UNITYTLS_SSL_HANDSHAKE_HELLO_VERIFY_REQUIRED = 17;
8787
/// <summary>Number of constant definitions</summary>
88-
public const int UNITYTLS_SSL_HANDSHAKE_COUNT = 19;
88+
public const int UNITYTLS_SSL_HANDSHAKE_COUNT = 28;
8989
/// <summary>Deprecated: for backward compatibility only</summary>
9090
public const int UNITYTLS_SSL_HANDSHAKE_BEGIN = 0;
9191
/// <summary>Deprecated: for backward compatibility only</summary>
92-
public const int UNITYTLS_SSL_HANDSHAKE_DONE = 16;
92+
public const int UNITYTLS_SSL_HANDSHAKE_DONE = 27;
9393
/// <summary>Deprecated: for backward compatibility only</summary>
9494
public const int UNITYTLS_SSL_HANDSHAKE_HANDSHAKE_FLUSH_BUFFERS = 14;
9595
/// <summary>Deprecated: for backward compatibility only</summary>
9696
public const int UNITYTLS_SSL_HANDSHAKE_HANDSHAKE_WRAPUP = 15;
9797
/// <summary>Deprecated: for backward compatibility only</summary>
98-
public const int UNITYTLS_SSL_HANDSHAKE_HANDSHAKE_OVER = 16;
98+
public const int UNITYTLS_SSL_HANDSHAKE_HANDSHAKE_OVER = 27;
9999
[StructLayout(LayoutKind.Sequential)]
100100
public struct unitytls_errorstate
101101
{

ModuleOverrides/com.unity.ui/Core/Controls/BaseVerticalCollectionView.cs

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -118,32 +118,32 @@ public abstract class BaseVerticalCollectionView : BindableElement, ISerializati
118118
/// use this event to update the binding events so the UI fits the new type.
119119
///\\
120120
///\\
121-
/// This event isn't raised if the selection or the size of the data source changes. For size changes, such as adding
122-
/// or removing an item from a list view, listen to the [[BaseListViewController.itemsSourceSizeChanged]] event.
121+
/// This event isn't raised if the selection or the size of the data source changes. For size changes, such as adding
122+
/// or removing an item from a list view, listen to the [[BaseListViewController.itemsSourceSizeChanged]] event.
123123
/// For selection changes, listen to the [[BaseVerticalCollectionView.selectionChanged]] event.
124124
/// </remarks>
125125
/// <example>
126-
/// The following example illustrates that the @@itemsSourceChanged@@ event is only triggered when the [[BaseVerticalCollectionView.itemsSource|itemsSource]] property is changed,
126+
/// The following example illustrates that the @@itemsSourceChanged@@ event is only triggered when the [[BaseVerticalCollectionView.itemsSource|itemsSource]] property is changed,
127127
/// not when the contents of the data source are modified.
128128
/// <code lang="cs">
129129
/// <![CDATA[
130130
/// var changedCount = 0;
131131
/// var source = new List<string>();
132132
/// var listView = new ListView();
133-
///
133+
///
134134
/// listView.itemsSourceChanged += () => changedCount++;
135-
///
135+
///
136136
/// // Changing the data source of the list view triggers the event.
137137
/// listView.itemsSource = source;
138-
///
139-
/// // Adding an item to the source doesn't trigger itemsSourceChanged
138+
///
139+
/// // Adding an item to the source doesn't trigger itemsSourceChanged
140140
/// // because the data source reference remains the same.
141-
/// source.Add("Hello World!");
142-
///
143-
/// // Adding an item to the ListView directly doesn't trigger itemsSourceChanged
141+
/// source.Add("Hello World!");
142+
///
143+
/// // Adding an item to the ListView directly doesn't trigger itemsSourceChanged
144144
/// // because the data source reference remains the same.
145-
/// listView.viewController.AddItems(1);
146-
///
145+
/// listView.viewController.AddItems(1);
146+
///
147147
/// Debug.Log(changedCount); // Outputs 1.
148148
/// ]]>
149149
/// </code>
@@ -1122,6 +1122,8 @@ private void OnPointerUp(PointerUpEvent evt)
11221122
}
11231123

11241124
private Vector3 m_TouchDownPosition;
1125+
private long m_LastPointerDownTimeStamp;
1126+
private int m_PointerDownCount;
11251127

11261128
private void ProcessPointerDown(IPointerEvent evt)
11271129
{
@@ -1137,10 +1139,17 @@ private void ProcessPointerDown(IPointerEvent evt)
11371139
if (evt.pointerType != PointerType.mouse)
11381140
{
11391141
m_TouchDownPosition = evt.position;
1142+
var pointerDownTimeStamp = (evt as PointerDownEvent)?.timestamp ?? 0;
1143+
m_PointerDownCount = pointerDownTimeStamp - m_LastPointerDownTimeStamp < Event.GetDoubleClickTime() ? m_PointerDownCount + 1 : 1;
1144+
m_LastPointerDownTimeStamp = pointerDownTimeStamp;
11401145
return;
11411146
}
1147+
else
1148+
{
1149+
m_PointerDownCount = evt.clickCount;
1150+
}
11421151

1143-
DoSelect(evt.localPosition, evt.clickCount, evt.actionKey, evt.shiftKey);
1152+
DoSelect(evt.localPosition, m_PointerDownCount, evt.actionKey, evt.shiftKey);
11441153
}
11451154

11461155
private void ProcessPointerUp(IPointerEvent evt)
@@ -1159,8 +1168,12 @@ private void ProcessPointerUp(IPointerEvent evt)
11591168
var delta = evt.position - m_TouchDownPosition;
11601169
if (delta.sqrMagnitude <= ScrollView.ScrollThresholdSquared)
11611170
{
1162-
DoSelect(evt.localPosition, evt.clickCount, evt.actionKey, evt.shiftKey);
1171+
DoSelect(evt.localPosition, m_PointerDownCount, evt.actionKey, evt.shiftKey);
11631172
}
1173+
1174+
// Reset the pointer down counter if it's passed the double click time.
1175+
var pointerUpTimeStamp = (evt as PointerUpEvent)?.timestamp ?? 0;
1176+
m_PointerDownCount = pointerUpTimeStamp - m_LastPointerDownTimeStamp < Event.GetDoubleClickTime() ? m_PointerDownCount : 0;
11641177
}
11651178
else
11661179
{

Modules/DeviceSimulatorEditor/UserInterfaceController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public UserInterfaceController(DeviceSimulatorMain deviceSimulatorMain, VisualEl
117117
m_ScaleSlider.lowValue = kScaleMin;
118118
m_ScaleSlider.highValue = kScaleMax;
119119
m_Scale = serializedState.scale;
120+
m_ScaleSlider.value = serializedState.scale;
120121
m_ScaleSlider.SetValueWithoutNotify(m_Scale);
121122
m_ScaleSlider.RegisterCallback<ChangeEvent<int>>(SetScale);
122123
m_ScaleValueLabel = rootVisualElement.Q<Label>("scale-value-label");

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Unity 2021.3.50f1 C# reference source code
1+
## Unity 2021.3.51f1 C# reference source code
22

33
The C# part of the Unity engine and editor source code.
44
May be used for reference purposes only.

0 commit comments

Comments
 (0)