Commit d3779f9 1 parent 213daa8 commit d3779f9 Copy full SHA for d3779f9
File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ private static void OnTMPChanged(TextMeshProUGUI textMeshProUGUI)
258
258
}
259
259
else if ( i - 1 < subMeshes . Count )
260
260
{
261
- var subMeshUI = GetSubMeshUI ( subMeshes , meshInfo . material ) ;
261
+ var subMeshUI = GetSubMeshUI ( subMeshes , meshInfo . material , i - 1 ) ;
262
262
if ( ! target || ! subMeshUI ) break ;
263
263
264
264
var replica = subMeshUI . GetOrAddComponent < UIEffectReplica > ( ) ;
@@ -285,11 +285,13 @@ private static void OnTMPChanged(TextMeshProUGUI textMeshProUGUI)
285
285
s_Mesh . Clear ( false ) ;
286
286
}
287
287
288
- private static TMP_SubMeshUI GetSubMeshUI ( List < TMP_SubMeshUI > subMeshes , Material material )
288
+ private static TMP_SubMeshUI GetSubMeshUI ( List < TMP_SubMeshUI > subMeshes , Material material , int start )
289
289
{
290
- for ( var j = 0 ; j < subMeshes . Count ; j ++ )
290
+ var count = subMeshes . Count ;
291
+ for ( var j = 0 ; j < count ; j ++ )
291
292
{
292
- if ( subMeshes [ j ] . sharedMaterial == material ) return subMeshes [ j ] ;
293
+ var s = subMeshes [ ( j + start + count ) % count ] ;
294
+ if ( s . sharedMaterial == material ) return s ;
293
295
}
294
296
295
297
return null ;
You can’t perform that action at this time.
0 commit comments