Skip to content

Commit 5ed3c98

Browse files
author
Unity Technologies
committed
Unity 2022.3.63f1 C# reference source code
1 parent 78242d3 commit 5ed3c98

File tree

11 files changed

+49
-15
lines changed

11 files changed

+49
-15
lines changed

Editor/Mono/GUI/Tools/BuiltinTools.cs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,23 @@ static Vector3 ResizeHandlesGUI(Rect rect, Vector3 pivot, Quaternion rotation, o
721721

722722
Vector3 sizeBefore = inverseRotation * (origPos - scalePivot);
723723
Vector3 sizeAfter = inverseRotation * (newPos - scalePivot);
724+
725+
// Fix for UUM-102690. If difference is zero, we don't want to scale on that axis
726+
if (scaleFromPivot)
727+
{
728+
Vector3 diff = origPos - scalePivot;
729+
if (Mathf.Approximately(diff.x, 0f))
730+
{
731+
sizeBefore.x = 1f;
732+
sizeAfter.x = 1f;
733+
}
734+
if (Mathf.Approximately(diff.y, 0f))
735+
{
736+
sizeBefore.y = 1f;
737+
sizeAfter.y = 1f;
738+
}
739+
}
740+
724741
if (xHandle != 1)
725742
scale.x = sizeAfter.x / sizeBefore.x;
726743
if (yHandle != 1)
@@ -731,12 +748,6 @@ static Vector3 ResizeHandlesGUI(Rect rect, Vector3 pivot, Quaternion rotation, o
731748
float refScale = (xHandle == 1 ? scale.y : scale.x);
732749
scale = Vector3.one * refScale;
733750
}
734-
735-
if (uniformScaling)
736-
{
737-
float refScale = (xHandle == 1 ? scale.y : scale.x);
738-
scale = Vector3.one * refScale;
739-
}
740751
}
741752

742753
if (xHandle == 0)

Editor/Mono/Overlays/OverlayCanvas.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ internal OverlayContainer GetDockZoneContainer(DockZone zone)
218218
List<Overlay> m_Overlays = new List<Overlay>();
219219
List<Overlay> m_TransientOverlays = new();
220220

221-
221+
internal static string k_DefaultPresetName = "Default";
222222
[SerializeField]
223-
string m_LastAppliedPresetName = "Default";
223+
string m_LastAppliedPresetName = k_DefaultPresetName;
224224

225225
[SerializeField]
226226
List<SaveData> m_SaveData = new List<SaveData>();
@@ -574,6 +574,11 @@ internal void CopySaveData(out SaveData[] saveData)
574574
saveData[i] = new SaveData(saveData[i]);
575575
}
576576

577+
internal void SetLastAppliedPresetName(string name)
578+
{
579+
m_LastAppliedPresetName = name;
580+
}
581+
577582
internal void ApplyPreset(OverlayPreset preset)
578583
{
579584
if (!preset.CanApplyToWindow(containerWindow.GetType()))
@@ -583,7 +588,7 @@ internal void ApplyPreset(OverlayPreset preset)
583588
return;
584589
}
585590

586-
m_LastAppliedPresetName = preset.name;
591+
SetLastAppliedPresetName(preset.name);
587592
ApplySaveData(preset.saveData);
588593
}
589594

Editor/Mono/Overlays/OverlayPresetManager.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@ public static void GenerateMenu(GenericMenu menu, string pathPrefix, EditorWindo
351351
menu.AddItem(EditorGUIUtility.TrTextContent($"{pathPrefix}Delete Preset/{preset.name}"), false, () =>
352352
{
353353
DeletePreset(preset);
354+
window.overlayCanvas.SetLastAppliedPresetName(OverlayCanvas.k_DefaultPresetName);
355+
window.overlayCanvas.afterOverlaysInitialized.Invoke();
354356
});
355357
}
356358

@@ -363,6 +365,7 @@ public static void GenerateMenu(GenericMenu menu, string pathPrefix, EditorWindo
363365
{
364366
RevertPreferencesPresetsToDefault();
365367
ReloadAllPresets();
368+
window.overlayCanvas.ApplyPreset(GetDefaultPreset(window.GetType()));
366369
}
367370
});
368371
}

Editor/Mono/ProjectWindow/ProjectWindowUtil.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,13 @@ internal static bool DeleteAssets(List<int> instanceIDs, bool askIfSure)
10151015
infotext.AppendLine("");
10161016
infotext.AppendLine(L10n.Tr("You cannot undo the delete assets action."));
10171017

1018-
containsMaterial &= AnyTargetMaterialHasChildren(paths);
1018+
if (containsMaterial)
1019+
{
1020+
// If the assets to be deleted contain a material, check for its children.
1021+
// Warning: AnyTargetMaterialHasChildren will load assets so it can be costly.
1022+
containsMaterial = AnyTargetMaterialHasChildren(paths);
1023+
}
1024+
10191025
if (containsMaterial)
10201026
{
10211027
infotext.AppendLine();

External/MirroredPackageSources/com.unity.ui.builder/Editor/Builder/Builder.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ public override void SaveChanges()
233233

234234
public override void DiscardChanges()
235235
{
236+
// Ensure stylesheet cache will be up to date.
237+
UnityEngine.UIElements.StyleSheets.StyleSheetCache.ClearCaches();
238+
236239
// Restore UXML and USS assets from backup
237240
document.RestoreAssetsFromBackup();
238241

External/NiceIO/NiceIO.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
using File = NiceIO.Do_Not_Use_File_Directly_Use_FileSystem_Active_Instead;
1616
using Directory = NiceIO.Do_Not_Use_Directory_Directly_Use_FileSystem_Active_Instead;
1717

18+
#nullable disable
19+
1820
namespace NiceIO
1921
{
2022
/// <summary>

ModuleOverrides/com.unity.ui/Editor/Bindings/DefaultSerializedObjectBindingImplementation.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,13 @@ public void Bind(VisualElement element)
327327
context.Bind(element);
328328
break;
329329
case RequestType.DelayBind:
330-
if (context.IsValid() && parentProperty != null && parentProperty.isValid) // Sometimes our serializedObject or serializedProperty might have become invalid/null, after a domain reload
330+
if (context.IsValid()) // Sometimes our serializedObject or serializedProperty might have become invalid/null, after a domain reload
331331
{
332-
parentProperty.Verify();
333-
context.ContinueBinding(element, parentProperty);
332+
if (parentProperty == null || parentProperty.isValid)
333+
{
334+
parentProperty?.Verify();
335+
context.ContinueBinding(element, parentProperty);
336+
}
334337
}
335338
break;
336339
case RequestType.TrackProperty:

Modules/PackageManager/Editor/Managed/PackageManager.bindings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ internal static void Resolve(bool force)
8787
[StaticAccessor("PackageManager", StaticAccessorType.DoubleColon)]
8888
internal class Folders
8989
{
90+
[ThreadAndSerializationSafe]
9091
public static extern string GetPackagesPath();
9192
public static extern bool IsPackagedAssetPath(string path);
9293
public static extern string[] GetPackagesPaths();

Projects/CSharp/UnityEditor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<GenerateDocumentationFile>false</GenerateDocumentationFile>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<EnableDefaultItems>false</EnableDefaultItems>
8-
<DefineConstants>$(DefineConstants);COMBINED_ASSEMBLIES;DEBUG;DEBUGGER_LISTENS_FIXED_PORT;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;ENABLE_ALTERNATIVE_LISTEN_PORT;ENABLE_AR;ENABLE_AUDIO;ENABLE_AUDIO_MANAGER_BASED_SCHEDULING;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_CLOUD_LICENSE;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_SERVICES_COLLAB_TESTING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLUSTERINPUT;ENABLE_CLUSTER_SYNC;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_EDITOR_GAME_SERVICES;ENABLE_EDITOR_HUB_LICENSE;ENABLE_ETC_COMPRESSION;ENABLE_EVENT_QUEUE;ENABLE_GAMECENTER_API;ENABLE_GENERATE_NATIVE_PLUGINS_FOR_ASSEMBLIES_API;ENABLE_HOLOLENS_MODULE_API;ENABLE_LZMA;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_UNITYTLS;ENABLE_MICROPHONE;ENABLE_MONO;ENABLE_MOVIES;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NAVIGATION_HEIGHTMESH_RUNTIME_SUPPORT;ENABLE_NAVIGATION_PACKAGE_DEBUG_VISUALIZATION;ENABLE_NAVIGATION_UI_REQUIRES_PACKAGE;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_PHYSICS;ENABLE_RUNTIME_GI;ENABLE_SCRIPTING_GC_WBARRIERS;ENABLE_TEXTURE_STREAMING;ENABLE_UNITYEVENTS;ENABLE_UNITYWEBREQUEST;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_VERSION_CONTROL_INTEGRATION;ENABLE_VIDEO;ENABLE_VIRTUALTEXTURING;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WEBSOCKET_CLIENT;ENABLE_WEBSOCKET_HOST;ENABLE_WWW;INCLUDE_DYNAMIC_GI;PLATFORM_HAS_BUGGY_VULKAN_SWAPCHAIN_USAGE;PLATFORM_SUPPORTS_GAMEPAD_AUDIO;PLATFORM_SUPPORTS_MONO;PLAYERCONNECTION_LISTENS_FIXED_PORT;RENDER_SOFTWARE_CURSOR;TEXTCORE_1_0_OR_NEWER;TRACE;UNITY_ANDROID_API;UNITY_ASSEMBLIES_API;UNITY_ASSERTIONS;UNITY_CAN_SHOW_SPLASH_SCREEN;UNITY_EDITOR;UNITY_EDITOR_API;UNITY_EDITOR_LINUX;UNITY_IPHONE_API;UNITY_METRO_API;UNITY_PS4_API;UNITY_PS5_API;UNITY_STANDALONE_LINUX_API;UNITY_STANDALONE_OSX_API;UNITY_STANDALONE_WIN_API;UNITY_TINYPROFILING_INTERNAL;UNITY_TVOS_API;UNITY_UNITYADS_API;UNITY_WEBGL_API;USE_PROPERTY_DATABASE;USE_QUERY_BUILDER;USE_SEARCH_ENGINE_API;USE_SEARCH_MODULE</DefineConstants>
8+
<DefineConstants>$(DefineConstants);COMBINED_ASSEMBLIES;DEBUG;DEBUGGER_LISTENS_FIXED_PORT;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;ENABLE_ALTERNATIVE_LISTEN_PORT;ENABLE_AR;ENABLE_AUDIO;ENABLE_AUDIO_MANAGER_BASED_SCHEDULING;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_CLOUD_LICENSE;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_SERVICES_COLLAB_TESTING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLUSTERINPUT;ENABLE_CLUSTER_SYNC;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_EDITOR_GAME_SERVICES;ENABLE_EDITOR_HUB_LICENSE;ENABLE_ETC_COMPRESSION;ENABLE_EVENT_QUEUE;ENABLE_GAMECENTER_API;ENABLE_GENERATE_NATIVE_PLUGINS_FOR_ASSEMBLIES_API;ENABLE_HOLOLENS_MODULE_API;ENABLE_LZMA;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_UNITYTLS;ENABLE_MICROPHONE;ENABLE_MONO;ENABLE_MOVIES;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NAVIGATION_HEIGHTMESH_RUNTIME_SUPPORT;ENABLE_NAVIGATION_PACKAGE_DEBUG_VISUALIZATION;ENABLE_NAVIGATION_UI_REQUIRES_PACKAGE;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_PHYSICS;ENABLE_RUNTIME_GI;ENABLE_SCRIPTING_GC_WBARRIERS;ENABLE_TEXTURE_STREAMING;ENABLE_UNITYEVENTS;ENABLE_UNITYWEBREQUEST;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_VERSION_CONTROL_INTEGRATION;ENABLE_VIDEO;ENABLE_VIRTUALTEXTURING;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WEBSOCKET_CLIENT;ENABLE_WEBSOCKET_HOST;ENABLE_WWW;INCLUDE_DYNAMIC_GI;PLATFORM_SUPPORTS_GAMEPAD_AUDIO;PLATFORM_SUPPORTS_MONO;PLAYERCONNECTION_LISTENS_FIXED_PORT;RENDER_SOFTWARE_CURSOR;TEXTCORE_1_0_OR_NEWER;TRACE;UNITY_ANDROID_API;UNITY_ASSEMBLIES_API;UNITY_ASSERTIONS;UNITY_CAN_SHOW_SPLASH_SCREEN;UNITY_EDITOR;UNITY_EDITOR_API;UNITY_EDITOR_LINUX;UNITY_IPHONE_API;UNITY_METRO_API;UNITY_PS4_API;UNITY_PS5_API;UNITY_STANDALONE_LINUX_API;UNITY_STANDALONE_OSX_API;UNITY_STANDALONE_WIN_API;UNITY_TINYPROFILING_INTERNAL;UNITY_TVOS_API;UNITY_UNITYADS_API;UNITY_WEBGL_API;USE_PROPERTY_DATABASE;USE_QUERY_BUILDER;USE_SEARCH_ENGINE_API;USE_SEARCH_MODULE</DefineConstants>
99
<LangVersion>latest</LangVersion>
1010
<NoWarn>1071;0169;0649;0626</NoWarn>
1111
</PropertyGroup>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Unity 2022.3.62f1 C# reference source code
1+
## Unity 2022.3.63f1 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)