private void Take(Profile.Character itemHaveCharacter, Item currentItem) { // Appear var currentItems = inventoryManager.selectedCharacter.ItemList; if (currentItems.Count >= inventoryManager.limitSlot) { return; } currentItems.Add(new Item(marketManager.ownedItems.Find(i => i.ItemId == currentItem.ItemId))); foreach (var slot in inventoryManager.slotList) { if (slot.gameObject.activeSelf == false) { inventoryManager.equipItem.Add(new Item(marketManager.ownedItems.Find(i => i.ItemId == currentItem.ItemId))); slot.gameObject.SetActive(true); var slotButton = slot.GetComponent <ItemButtonManager>(); Insert(slotButton, currentItem); break; } } // Disappear itemHaveCharacter.ItemList.RemoveAll(i => i.ItemId == itemId); }
public void SetProfile() { SetBicProfile(0); characterSelect.ReSetting(); for (int i = 0; i < characterManager.currentCharacterList.Count; i++) { characterSelect.buttonList[i].SetActive(true); characterSelect.buttonList[i].GetComponent <CharacterManager>().id = characterManager.currentCharacterList[i].CharacterId; characterSelect.buttonList[i].transform.Find("ProfileImage").GetComponent <Image>().sprite = characterManager.currentCharacterList[i].Profile.transform.Find("100x100").GetComponent <Image>().sprite; } selectedCharacter = characterManager.currentCharacterList[0]; characterSelect.activeList[0].SetActive(true); }