Skip to content

Commit

Permalink
Unity 6000.0.19f1 C# reference source code
Browse files Browse the repository at this point in the history
  • Loading branch information
Unity Technologies committed Sep 12, 2024
1 parent 6500e74 commit d487c13
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Editor/Mono/GUIView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ public static void BeginOffsetArea(Rect screenRect, GUIContent content, GUIStyle

public static void EndOffsetArea()
{
GUILayoutUtility.EndLayoutGroup();
GUI.EndGroup();
GUILayoutUtility.EndLayoutGroup();
}

// we already have renderdoc integration done in GUIView but in cpp
Expand Down
6 changes: 5 additions & 1 deletion Editor/Mono/HostView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -538,12 +538,16 @@ public void InvokeOnGUI(Rect onGUIPosition)
}
finally
{
// We explicitly called BeginOffsetArea outside this try-catch scope,
// so we need to always explicitly end it as well just like all other
// GUI scopes are responsible for dealing with ExitGUI properly.
EndOffsetArea();

// We can't reset gui state after ExitGUI we just want to bail completely
if (!(isExitGUIException || GUIUtility.guiIsExiting))
{
CheckNotificationStatus();

EndOffsetArea();
if (GUILayoutUtility.unbalancedgroupscount != 0)
{
Debug.LogError("GUI Error: Invalid GUILayout state in " + GetActualViewName() + " view. Verify that all layout Begin/End calls match");
Expand Down
8 changes: 8 additions & 0 deletions Editor/Mono/Shaders/ShaderKeywordFilterData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ internal static SettingsNode GatherFilterData(string nodeName, object containerO
if (containerObject == null)
return node;

// Unity objects have their own validity checking
if (containerObject is UnityEngine.Object)
{
var unityObject = containerObject as UnityEngine.Object;
if (!unityObject)
return node;
}

if (!visited.Add(containerObject))
return node;

Expand Down
4 changes: 1 addition & 3 deletions Modules/TextCoreTextEngine/Managed/TextHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,12 @@ public void AddTextInfoToTemporaryCache(int hashCode)

public void RemoveTextInfoFromTemporaryCache()
{
if (useAdvancedText)
return;
s_TemporaryCache.RemoveTextInfoFromCache(this);
}

public void RemoveTextInfoFromPermanentCache()
{
if (useAdvancedText)
if (textGenerationInfo != IntPtr.Zero)
{
TextGenerationInfo.Destroy(textGenerationInfo);
textGenerationInfo = IntPtr.Zero;
Expand Down
6 changes: 5 additions & 1 deletion Modules/UIElements/Core/Text/UITKTextHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,13 @@ internal float GetVertexPadding(FontAsset fontAsset)
private bool wasAdvancedTextEnabledForElement;
internal override bool IsAdvancedTextEnabledForElement()
{
// When it's called on a thread it automatically means it's not ATG, so we just return false.
if (JobsUtility.IsExecutingJob)
return false;

bool isEnabled = TextUtilities.IsAdvancedTextEnabledForElement(m_TextElement);
// We need to cleanup caches to avoid exceptions when switching between advanced and non-advanced text
if (wasAdvancedTextEnabledForElement && !isEnabled && textGenerationInfo != IntPtr.Zero && !JobsUtility.IsExecutingJob)
if (wasAdvancedTextEnabledForElement && !isEnabled && textGenerationInfo != IntPtr.Zero)
{
TextGenerationInfo.Destroy(textGenerationInfo);
textGenerationInfo = IntPtr.Zero;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Unity 6000.0.18f1 C# reference source code
## Unity 6000.0.19f1 C# reference source code

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

0 comments on commit d487c13

Please sign in to comment.