@@ -115,6 +115,7 @@ public static string GetPlatform()
115115 }
116116
117117 private static Bootstrap _instance ;
118+ private static void SetInstance ( Bootstrap instance ) => _instance = instance ;
118119
119120 [ RuntimeInitializeOnLoadMethod ( RuntimeInitializeLoadType . AfterAssembliesLoaded ) ]
120121 private static void SetUpStaticSecretKey ( )
@@ -141,7 +142,7 @@ private async UniTask SetUpDynamicSecret()
141142 Debug . Log ( "SetUpDynamicSecret begin" ) ;
142143 var handle = YooAssets . LoadAssetAsync < TextAsset > ( dynamicSecretKeyPath ) ;
143144 await handle . Task ;
144- TextAsset dynamicSecretKeyAsset = ( TextAsset ) handle . AssetObject ;
145+ TextAsset dynamicSecretKeyAsset = handle . GetAssetObject < TextAsset > ( ) ;
145146 EncryptionService < DefaultDynamicEncryptionScope > . Encryptor =
146147 new GeneratedEncryptionVirtualMachine ( dynamicSecretKeyAsset . bytes ) ;
147148 handle . Release ( ) ;
@@ -153,7 +154,7 @@ private async UniTask LoadMetadataForAOTAssemblies()
153154 {
154155 var aotListHandle = YooAssets . LoadAssetAsync < TextAsset > ( aotDllListFilePath ) ;
155156 await aotListHandle . Task ;
156- TextAsset aotDataAsset = ( TextAsset ) aotListHandle . AssetObject ;
157+ TextAsset aotDataAsset = aotListHandle . GetAssetObject < TextAsset > ( ) ;
157158 var aotDllList = NinoDeserializer . Deserialize < List < string > > ( aotDataAsset . bytes ) ;
158159 aotListHandle . Release ( ) ;
159160
@@ -167,7 +168,7 @@ private async UniTask LoadMetadataForAOTAssemblies()
167168
168169 var handle = YooAssets . LoadAssetAsync < TextAsset > ( aotDllName ) ;
169170 await handle . Task ;
170- byte [ ] dllBytes = ( ( TextAsset ) handle . AssetObject ) . bytes ;
171+ byte [ ] dllBytes = handle . GetAssetObject < TextAsset > ( ) . bytes ;
171172 var err = RuntimeApi . LoadMetadataForAOTAssembly ( dllBytes , HomologousImageMode . SuperSet ) ;
172173 Debug . Log ( $ "LoadMetadataForAOTAssembly:{ aotDllName } . ret:{ err } ") ;
173174 handle . Release ( ) ;
@@ -181,7 +182,7 @@ private void Awake()
181182 DestroyImmediate ( _instance ) ;
182183 }
183184
184- _instance = this ;
185+ SetInstance ( this ) ;
185186 DontDestroyOnLoad ( gameObject ) ;
186187
187188 startButton ? . gameObject . SetActive ( true ) ;
0 commit comments