@@ -146,7 +146,7 @@ void OnLetterCardsChanged()
146
146
147
147
if ( Gameplay . instance != null && Gameplay . instance . state != Gameplay . State . Stopped )
148
148
{
149
- this . DelayRefreshHierarchy ( AccessibilityManager . GetService < UGuiAccessibilityService > ( ) ) ;
149
+ AccessibilityManager . GetService < UGuiAccessibilityService > ( ) ? . RebuildHierarchy ( ) ;
150
150
151
151
Invoke ( nameof ( MoveAccessibilityFocusOnClue ) , 1f ) ;
152
152
}
@@ -165,7 +165,7 @@ bool OnLetterCardSelected()
165
165
166
166
// When a letter card is selected, deactivate all accessibility nodes except the ones corresponding to
167
167
// 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 ) ;
169
169
170
170
letterCard . SetDraggingVisuals ( true ) ;
171
171
SetLetterCardsAccessibilityLabel ( false ) ;
@@ -174,7 +174,7 @@ bool OnLetterCardSelected()
174
174
{
175
175
m_AccessibilitySelectedCard = null ;
176
176
177
- AccessibilityManager . GetService < UGuiAccessibilityService > ( ) . ActivateOtherAccessibilityNodes ( true , letterCardContainer ) ;
177
+ AccessibilityManager . GetService < UGuiAccessibilityService > ( ) ? . ActivateOtherAccessibilityNodes ( true , letterCardContainer ) ;
178
178
179
179
letterCard . SetDraggingVisuals ( false ) ;
180
180
SetLetterCardsAccessibilityLabel ( true ) ;
@@ -234,7 +234,7 @@ void OnNodeFocusChanged(AccessibilityNode node)
234
234
{
235
235
if ( node != null )
236
236
{
237
- var element = AccessibilityManager . GetService < UGuiAccessibilityService > ( ) . GetAccessibleElementForNode ( node ) ;
237
+ var element = AccessibilityManager . GetService < UGuiAccessibilityService > ( ) ? . GetAccessibleElementForNode ( node ) ;
238
238
m_AccessibilityFocusedCard = element != null ? element . GetComponent < LetterCard > ( ) : null ;
239
239
MoveSelectedCard ( ) ;
240
240
}
@@ -313,23 +313,23 @@ void MoveCard(bool shouldMoveLeft, int count)
313
313
// we need to recreate the whole hierarchy instead.
314
314
if ( Application . platform == RuntimePlatform . IPhonePlayer )
315
315
{
316
- AccessibilityManager . GetService < UGuiAccessibilityService > ( ) . RebuildHierarchy ( ) ;
316
+ AccessibilityManager . GetService < UGuiAccessibilityService > ( ) ? . RebuildHierarchy ( ) ;
317
317
m_WasHierarchyRefreshed = true ;
318
318
319
319
// Add the node count to the element ID to match the ID of the node in the refreshed hierarchy,
320
320
// ensuring consistent focus even after rebuilding.
321
321
var nodeToFocusId = element . node . id + AccessibilityManager . hierarchy . rootNodes . Count ;
322
322
nodeToFocusId += shouldMoveLeft ? - count : count ;
323
323
324
- this . DelayFocusOnNode ( nodeToFocusId ) ;
324
+ StartCoroutine ( this . FocusOnNode ( nodeToFocusId ) ) ;
325
325
}
326
326
else
327
327
{
328
328
AccessibilityManager . hierarchy . MoveNode ( element . node , element . node . parent ,
329
329
element . transform . GetSiblingIndex ( ) ) ;
330
330
331
331
// Only refresh the frames for now to leave the announcement request to be handled.
332
- this . DelayRefreshNodeFrames ( ) ;
332
+ StartCoroutine ( this . RefreshNodeFrames ( ) ) ;
333
333
334
334
AssistiveSupport . notificationDispatcher . SendLayoutChanged ( element . node ) ;
335
335
}
0 commit comments