Fix loading possesable avatar by name

This commit is contained in:
Pascal Serrarens 2022-02-21 15:30:32 +01:00
parent d6de90fbe9
commit c512dd42c3

View File

@ -298,8 +298,17 @@ namespace Passer {
yield break; yield break;
} }
string possessableName = possessablePath;
int lastSlashIx = possessablePath.LastIndexOf('/');
if (lastSlashIx >= 0)
possessableName = possessablePath.Substring( + 1);
//string[] assetPaths = assetBundle.GetAllAssetNames();
//foreach (string assetPath in assetPaths) {
// Debug.Log(" " + assetPath);
//}
Debug.Log("Load: " + possessablePath); Debug.Log("Load: " + possessablePath);
prefab = assetBundle.LoadAsset<GameObject>(possessablePath); prefab = assetBundle.LoadAsset<GameObject>(possessableName); // possessablePath);
if (prefab == null) { if (prefab == null) {
Debug.LogError("Could not load " + possessablePath); Debug.LogError("Could not load " + possessablePath);
yield break; yield break;