using System.Collections.Generic; using Framework.Asset; using IcecreamView; using UnityEngine; namespace System.Loader { public class IC_AddressabelConfig : IC_IViewConfig { private Dictionary mViewDic; public void OnInit() { this.mViewDic = new Dictionary(); var views = AssetManager.Instance.LoadAssetsForComponent($"{AssetManager.ResRootPath}View"); if (views == null || views.Count <= 0) { return; } foreach (var view in views) { this.mViewDic[view.name] = new IC_ViewInfo() { View = view, Table = view.name, isOnce = true }; // Debug.Log("Load View : " + view.name); } } public string GetDefaultViewTable() { return null; } public bool ContainsKey(string viewTable) { return this.mViewDic.ContainsKey(viewTable); } public List GetCacheTables() { return new List(); } public IC_IViewInfo OnAddView(string viewTable) { return this.mViewDic[viewTable]; } public void OnRemoveView(IC_AbstractView view) { UnityEngine.Object.Destroy(view.gameObject); } public void OnDispose() { this.mViewDic.Clear(); GC.Collect(); } } }