예제 #1
0
 public ItemsMgr(WO_Player parent)
     : base(parent)
 {
     _wPlayer    = parent;
     _mPlayer    = _wPlayer.Player;
     _player     = _mPlayer.Player;
     m_data      = _mPlayer.Data;
     m_items     = m_data.Items;
     m_wears     = m_data.Wears;
     m_itemsHash = new HashSet <int>();
     foreach (var item in m_items)
     {
         var value = item.Value;
         if (!m_itemsHash.Contains(value.Item.Id))
         {
             m_itemsHash.Add(value.Item.Id);
         }
     }
     m_wearSlotsUsed = WearablePosition.None;
     foreach (var item in m_wears)
     {
         var     value = item.Value;
         DB_Item dbitem;
         if (DataMgr.Select(value.Id, out dbitem))
         {
             m_wearSlotsUsed |= dbitem.Slot;
         }
     }
     parent.OnSpawn   += ItemsMgr_OnSpawn;
     parent.OnDestroy += ItemsMgr_OnDestroy;
 }
예제 #2
0
 private void ItemsMgr_OnDestroy()
 {
     m_view      = null;
     m_data      = null;
     m_wears     = null;
     m_items     = null;
     _player     = null;
     _mPlayer    = null;
     _wPlayer    = null;
     m_itemsHash = null;
 }