using Newtonsoft.Json.Linq; using SFB; using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; using UnityEngine; public class EversoulAssetLibrary : AssetLibrary { public static EversoulAssetLibrary Instance => GetInstance(); private List assets = new List(); private Dictionary hashDirectories = new Dictionary(); private Dictionary hashAssets = new Dictionary(); private Dictionary assetHashes = new Dictionary(); public List CharacterAssets = new List(); public List AnimationAssets = new List(); public List Characters; IEnumerator Start() { var selectedFilePath = new string[0]; while (true) { Debug.LogError("IMPLEMENT SETTINGS!"); selectedFilePath = StandaloneFileBrowser.OpenFilePanel("Select catalog_eversoul.json", "", "json", false); if(selectedFilePath.Length > 0 && !string.IsNullOrEmpty(selectedFilePath[0])) { break; } yield return new WaitForSeconds(5); } string catalogPath = selectedFilePath[0]; selectedFilePath = new string[0]; while (true) { Debug.LogError("IMPLEMENT SETTINGS!"); selectedFilePath = StandaloneFileBrowser.OpenFolderPanel("Select folder with assets", "", false); if (selectedFilePath.Length > 0 && !string.IsNullOrEmpty(selectedFilePath[0])) { break; } yield return new WaitForSeconds(5); } LocalFilesPath = selectedFilePath[0] + "\\"; yield return LoadAddressableCatalog(catalogPath); var keys = GetAddressableKeys(); var charas = keys.Where(k => k.Contains("Character") && k.Contains("/Prefabs/") && k.EndsWith(".prefab")).ToList(); foreach(var chara in charas) { Characters.Add(new CharacterAsset(chara)); } CharacterAssets = charas; EversoulInterface.Instance.CharacterSelection.SetData(Characters); yield break; } }