Skip to content

Commit d487c13

Browse files
author
Unity Technologies
committed
Unity 6000.0.19f1 C# reference source code
1 parent 6500e74 commit d487c13

File tree

6 files changed

+21
-7
lines changed

6 files changed

+21
-7
lines changed

Editor/Mono/GUIView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ public static void BeginOffsetArea(Rect screenRect, GUIContent content, GUIStyle
290290

291291
public static void EndOffsetArea()
292292
{
293-
GUILayoutUtility.EndLayoutGroup();
294293
GUI.EndGroup();
294+
GUILayoutUtility.EndLayoutGroup();
295295
}
296296

297297
// we already have renderdoc integration done in GUIView but in cpp

Editor/Mono/HostView.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,12 +538,16 @@ public void InvokeOnGUI(Rect onGUIPosition)
538538
}
539539
finally
540540
{
541+
// We explicitly called BeginOffsetArea outside this try-catch scope,
542+
// so we need to always explicitly end it as well just like all other
543+
// GUI scopes are responsible for dealing with ExitGUI properly.
544+
EndOffsetArea();
545+
541546
// We can't reset gui state after ExitGUI we just want to bail completely
542547
if (!(isExitGUIException || GUIUtility.guiIsExiting))
543548
{
544549
CheckNotificationStatus();
545550

546-
EndOffsetArea();
547551
if (GUILayoutUtility.unbalancedgroupscount != 0)
548552
{
549553
Debug.LogError("GUI Error: Invalid GUILayout state in " + GetActualViewName() + " view. Verify that all layout Begin/End calls match");

Editor/Mono/Shaders/ShaderKeywordFilterData.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,14 @@ internal static SettingsNode GatherFilterData(string nodeName, object containerO
195195
if (containerObject == null)
196196
return node;
197197

198+
// Unity objects have their own validity checking
199+
if (containerObject is UnityEngine.Object)
200+
{
201+
var unityObject = containerObject as UnityEngine.Object;
202+
if (!unityObject)
203+
return node;
204+
}
205+
198206
if (!visited.Add(containerObject))
199207
return node;
200208

Modules/TextCoreTextEngine/Managed/TextHandle.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,12 @@ public void AddTextInfoToTemporaryCache(int hashCode)
167167

168168
public void RemoveTextInfoFromTemporaryCache()
169169
{
170-
if (useAdvancedText)
171-
return;
172170
s_TemporaryCache.RemoveTextInfoFromCache(this);
173171
}
174172

175173
public void RemoveTextInfoFromPermanentCache()
176174
{
177-
if (useAdvancedText)
175+
if (textGenerationInfo != IntPtr.Zero)
178176
{
179177
TextGenerationInfo.Destroy(textGenerationInfo);
180178
textGenerationInfo = IntPtr.Zero;

Modules/UIElements/Core/Text/UITKTextHandle.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,13 @@ internal float GetVertexPadding(FontAsset fontAsset)
240240
private bool wasAdvancedTextEnabledForElement;
241241
internal override bool IsAdvancedTextEnabledForElement()
242242
{
243+
// When it's called on a thread it automatically means it's not ATG, so we just return false.
244+
if (JobsUtility.IsExecutingJob)
245+
return false;
246+
243247
bool isEnabled = TextUtilities.IsAdvancedTextEnabledForElement(m_TextElement);
244248
// We need to cleanup caches to avoid exceptions when switching between advanced and non-advanced text
245-
if (wasAdvancedTextEnabledForElement && !isEnabled && textGenerationInfo != IntPtr.Zero && !JobsUtility.IsExecutingJob)
249+
if (wasAdvancedTextEnabledForElement && !isEnabled && textGenerationInfo != IntPtr.Zero)
246250
{
247251
TextGenerationInfo.Destroy(textGenerationInfo);
248252
textGenerationInfo = IntPtr.Zero;

README.md

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