You've already forked taptap2024_GJ_chidouren
init
This commit is contained in:
64
Assets/Scripts/System/Loader/IC_AddressabelConfig.cs
Normal file
64
Assets/Scripts/System/Loader/IC_AddressabelConfig.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using System.Collections.Generic;
|
||||
using Framework.Asset;
|
||||
using IcecreamView;
|
||||
using UnityEngine;
|
||||
|
||||
namespace System.Loader
|
||||
{
|
||||
public class IC_AddressabelConfig : IC_IViewConfig
|
||||
{
|
||||
private Dictionary<string, IC_IViewInfo> mViewDic;
|
||||
|
||||
public void OnInit()
|
||||
{
|
||||
this.mViewDic = new Dictionary<string, IC_IViewInfo>();
|
||||
var views = AssetManager.Instance.LoadAssetsForComponent<IC_AbstractView>($"{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<string> GetCacheTables()
|
||||
{
|
||||
return new List<string>();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user