using FirstVillain.Entities; using FirstVillain.Singleton; using Newtonsoft.Json; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; //±ÔÄ¢ : Å×À̺íÀ» ÇÊ¿äÇÒ ¶§¸¶´Ù ·ÎµåÇؼ­ »ç¿ëÇÑ´Ù. public class TableManager : UnitySingleton { private void LoadTable(E_TABLE table, Action> result) { AddressableManager.Instance.LoadAssetAsync(table.ToString(), asset => { result(JsonConvert.DeserializeObject>(asset.text)); }); } //Å×ÀÌºíº°·Î Å×ÀÌºí °¡Á®¿À´Â ÇÔ¼ö¸¦ °è¼Ó Ãß°¡ÇØ Áà¾ßÇÏ´Â ´ÜÁ¡... #region Prop public void GetPropInfoById(E_TABLE table, int id, Action result) { LoadTable(table, loaded => { var list = loaded.list; result(list.Find(arg => arg.Id == id)); }); } public void GetPropInfoList(E_TABLE table, Action> result) { LoadTable(table, loaded => { result(loaded.list); }); } #endregion Prop }