How to track loaded resources: mudanças entre as edições
Sem resumo de edição |
Sem resumo de edição |
||
Linha 8: | Linha 8: | ||
} | } | ||
//Iterate the loaded textures list | |||
foreach (var kvp in assetLoaderContext.LoadedTextures) | foreach (var kvp in assetLoaderContext.LoadedTextures) | ||
{ | { | ||
Linha 18: | Linha 19: | ||
} | } | ||
//Iterate the loaded resources list | |||
foreach (var kvp in assetLoaderContext.LoadedExternalData) | foreach (var kvp in assetLoaderContext.LoadedExternalData) | ||
{ | { |
Edição das 09h02min de 8 de junho de 2021
On your "onMaterialsLoad" callback, you can use the following snippet to track the loaded resources, in case you need to copy/move them elsewhere: <source lang="csharp"> //ModelPath contains the loaded model path var modelPath = assetLoaderContext.Filename; if (!string.IsNullOrEmpty(modelPath)) { //Do stuff }
//Iterate the loaded textures list foreach (var kvp in assetLoaderContext.LoadedTextures) { //FinalPath contains the loaded texture filename string finalPath = kvp.Key.ResolvedFilename; if (!string.IsNullOrEmpty(finalPath)) { //Do stuff } }
//Iterate the loaded resources list foreach (var kvp in assetLoaderContext.LoadedExternalData) { //FinalPath contains the loaded resource filename string finalPath = kvp.Value; if (!string.IsNullOrEmpty(finalPath)) { //Do stuff } } </source>