// Use this for initialization public void Initialize(CharacterEntity entity) { SetCharacterPortrait(entity.Icon); CharacterDataChanged(entity); entity.OnDataChanged += CharacterDataChanged; entity.EntityInventory.onCurrencyUpdated += CurrencyChanged; if (m_inventoryView != null) { m_inventoryView.InitializeInventoryView(entity, entity.EntityInventory.ClientInventoryItemClicked); } CurrencyChanged(entity.EntityInventory.Currency); }
// Use this for initialization public void Initialize(CharacterEntity entity) { if (!m_initialized) { foreach (BaseItemContainer item in InventoryManager.Instance.m_items) { ItemButton newButton = Instantiate <ItemButton>(m_itemButtonPrefab); newButton.transform.SetParent(m_itemContainer); newButton.UpdateItemContainer(item, ShowStoreItem); } if (m_inventoryView != null) { m_inventoryView.InitializeInventoryView(entity, ShowInventoryItem); } m_initialized = true; } }