Пример #1
0
 public void Awake()
 {
     loaded = true;
     dic    = new Dictionary <int, t_tpl_fishitem_item>();
     for (int i = 0, imax = dataArray.Length; i < imax; ++i)
     {
         t_tpl_fishitem_item item = dataArray[i];
         dic.Add(item.id, item);
     }
 }
Пример #2
0
    public static t_tpl_fishitem_item FindById(int id)
    {
        if (!loaded)
        {
            Debug.LogError("error not loaded!");
        }
        t_tpl_fishitem_item item = null;

        if (dic.TryGetValue(id, out item))
        {
            return(item);
        }
        return(null);
    }