@@ -146,7 +146,7 @@ void OnLetterCardsChanged()
146146
147147 if ( Gameplay . instance != null && Gameplay . instance . state != Gameplay . State . Stopped )
148148 {
149- this . DelayRefreshHierarchy ( AccessibilityManager . GetService < UGuiAccessibilityService > ( ) ) ;
149+ AccessibilityManager . GetService < UGuiAccessibilityService > ( ) ? . RebuildHierarchy ( ) ;
150150
151151 Invoke ( nameof ( MoveAccessibilityFocusOnClue ) , 1f ) ;
152152 }
@@ -165,7 +165,7 @@ bool OnLetterCardSelected()
165165
166166 // When a letter card is selected, deactivate all accessibility nodes except the ones corresponding to
167167 // the letter cards to allow the selected card to be moved correctly.
168- AccessibilityManager . GetService < UGuiAccessibilityService > ( ) . ActivateOtherAccessibilityNodes ( false , letterCardContainer ) ;
168+ AccessibilityManager . GetService < UGuiAccessibilityService > ( ) ? . ActivateOtherAccessibilityNodes ( false , letterCardContainer ) ;
169169
170170 letterCard . SetDraggingVisuals ( true ) ;
171171 SetLetterCardsAccessibilityLabel ( false ) ;
@@ -174,7 +174,7 @@ bool OnLetterCardSelected()
174174 {
175175 m_AccessibilitySelectedCard = null ;
176176
177- AccessibilityManager . GetService < UGuiAccessibilityService > ( ) . ActivateOtherAccessibilityNodes ( true , letterCardContainer ) ;
177+ AccessibilityManager . GetService < UGuiAccessibilityService > ( ) ? . ActivateOtherAccessibilityNodes ( true , letterCardContainer ) ;
178178
179179 letterCard . SetDraggingVisuals ( false ) ;
180180 SetLetterCardsAccessibilityLabel ( true ) ;
@@ -234,7 +234,7 @@ void OnNodeFocusChanged(AccessibilityNode node)
234234 {
235235 if ( node != null )
236236 {
237- var element = AccessibilityManager . GetService < UGuiAccessibilityService > ( ) . GetAccessibleElementForNode ( node ) ;
237+ var element = AccessibilityManager . GetService < UGuiAccessibilityService > ( ) ? . GetAccessibleElementForNode ( node ) ;
238238 m_AccessibilityFocusedCard = element != null ? element . GetComponent < LetterCard > ( ) : null ;
239239 MoveSelectedCard ( ) ;
240240 }
@@ -313,23 +313,23 @@ void MoveCard(bool shouldMoveLeft, int count)
313313 // we need to recreate the whole hierarchy instead.
314314 if ( Application . platform == RuntimePlatform . IPhonePlayer )
315315 {
316- AccessibilityManager . GetService < UGuiAccessibilityService > ( ) . RebuildHierarchy ( ) ;
316+ AccessibilityManager . GetService < UGuiAccessibilityService > ( ) ? . RebuildHierarchy ( ) ;
317317 m_WasHierarchyRefreshed = true ;
318318
319319 // Add the node count to the element ID to match the ID of the node in the refreshed hierarchy,
320320 // ensuring consistent focus even after rebuilding.
321321 var nodeToFocusId = element . node . id + AccessibilityManager . hierarchy . rootNodes . Count ;
322322 nodeToFocusId += shouldMoveLeft ? - count : count ;
323323
324- this . DelayFocusOnNode ( nodeToFocusId ) ;
324+ StartCoroutine ( this . FocusOnNode ( nodeToFocusId ) ) ;
325325 }
326326 else
327327 {
328328 AccessibilityManager . hierarchy . MoveNode ( element . node , element . node . parent ,
329329 element . transform . GetSiblingIndex ( ) ) ;
330330
331331 // Only refresh the frames for now to leave the announcement request to be handled.
332- this . DelayRefreshNodeFrames ( ) ;
332+ StartCoroutine ( this . RefreshNodeFrames ( ) ) ;
333333
334334 AssistiveSupport . notificationDispatcher . SendLayoutChanged ( element . node ) ;
335335 }
0 commit comments