We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a5add5 commit e663dbaCopy full SHA for e663dba
src/XUnity.AutoTranslator.Plugin.Core/TextTranslationInfo.cs
@@ -144,7 +144,11 @@ public void ChangeFont( object ui )
144
145
if( oldMaterial != null && newMaterial != null )
146
{
147
- if( !_FontMaterialCopies.TryGetValue( oldMaterial, out var copyMaterial ) )
+ if( !_FontMaterialCopies.TryGetValue( oldMaterial, out var copyMaterial )
148
+ #if IL2CPP
149
+ || copyMaterial.m_CachedPtr == IntPtr.Zero
150
+ #endif
151
+ )
152
153
copyMaterial = _FontMaterialCopies[ oldMaterial ] = UnityEngine.Object.Instantiate( oldMaterial );
154
0 commit comments