public async Task DownloadCharacter(string characterID) { if (!ConvaiAPIKeySetup.GetAPIKey(out string apiKey)) return; try { EditorUtility.DisplayProgressBar("Connecting", "Collecting resources...", 0f); GetResponse getResponseContent = await GetCharacterDataAsync(characterID, apiKey); string modelLink = getResponseContent.ModelDetail.ModelLink; string characterName = getResponseContent.CharacterName.Trim(); AvatarObjectLoader avatarLoader = new() { AvatarConfig = Resources.Load<AvatarConfig>("ConvaiRPMAvatarConfig") }; DirectoryUtility.DefaultAvatarFolder = $"Convai/Characters/Mesh Data/{characterName}"; CompletionEventArgs args = await LoadAvatarAsync(avatarLoader, modelLink, characterName); AvatarLoaderSettings avatarLoaderSettings = Resources.Load<AvatarLoaderSettings>("ConvaiAvatarLoaderSettings"); string path = Path.Combine("Assets", "Avatars", AvatarCache.GetAvatarConfigurationHash(avatarLoaderSettings.AvatarConfig).ToString(), args.Avatar.name); GameObject avatar = PrefabHelper.CreateAvatarPrefab(args.Metadata, path, avatarConfig: avatarLoaderSettings.AvatarConfig); SetupCharacter(characterID, characterName, avatar, args); ConvaiLogger.DebugLog($"Character '{characterName}' downloaded and set up successfully.", ConvaiLogger.LogCategory.Character); } catch (WebException e) { EditorUtility.ClearProgressBar(); ConvaiLogger.Error(e.Message + "\nPlease check if Character ID is correct.", ConvaiLogger.LogCategory.Character); } catch (Exception e) { EditorUtility.ClearProgressBar(); ConvaiLogger.Error(e.Message, ConvaiLogger.LogCategory.Character); } }
This is from the CharacterImporterLogic.cs. I have changed the DirectoryUtility to Path combine based on a post here. [‘DirectoryUtility’ does not contain a definition for ‘GetRelativeProjectPath’ - #4 by Niall_Mc_Cann](https://DirectoryUtility bug)