File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Packages/src/Runtime/Internal/Utilities Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 22using UnityEditor ;
33using UnityEngine ;
44using UnityEngine . UI ;
5+ using System . Reflection ;
56
67namespace Coffee . UIEffectInternal
78{
@@ -67,7 +68,15 @@ private static void InitializeAfterCanvasRebuild()
6768 if ( s_IsInitializedAfterCanvasRebuild ) return ;
6869 s_IsInitializedAfterCanvasRebuild = true ;
6970
71+ // Explicitly set `Canvas.willRenderCanvases += CanvasUpdateRegistry.PerformUpdate`.
7072 CanvasUpdateRegistry . IsRebuildingLayout ( ) ;
73+ #if TMP_ENABLE
74+ // Explicitly set `Canvas.willRenderCanvases += TMP_UpdateManager.DoRebuilds`.
75+ typeof ( TMPro . TMP_UpdateManager )
76+ . GetProperty ( "instance" , BindingFlags . NonPublic | BindingFlags . Static )
77+ . GetValue ( null ) ;
78+ #endif
79+ Canvas . willRenderCanvases -= OnAfterCanvasRebuild ;
7180 Canvas . willRenderCanvases += OnAfterCanvasRebuild ;
7281 Logging . LogMulticast ( typeof ( Canvas ) , "willRenderCanvases" ,
7382 message : "InitializeAfterCanvasRebuild" ) ;
You can’t perform that action at this time.
0 commit comments