public void Equip(int bulletType, int index) { GameManager.Inst().UpgManager.BData[bulletType].SetEquipIndex(index); //Vamp if (GameManager.Inst().Player.GetItem(index).Type == (int)Item_ZzinEquipment.EquipType.VAMP) { EquipVamp(); } //Reinforce if (GameManager.Inst().Player.GetItem(index).Type == (int)Item_ZzinEquipment.EquipType.REINFORCE) { EquipReinforce(); } //Weapon UI SetWeaponUI(); //InventorySlot UI if (index == -1) { return; } InventorySlot slot = Inventories.GetSlot(Inventories.GetSwitchedIndex(index)); slot.EMark.SetActive(true); GameManager.Inst().SodManager.PlayEffect("Equip change"); }
public void DisableSelectedSlot() { if (SelectedIndex <= -1) { return; } //for (int i = 0; i < GameManager.Inst().Player.MAXINVENTORY; i++) //{ // if (Inventories.GetSlot(i).GetItemUID() == GameManager.Inst().Player.GetItem(SelectedIndex).UID) // Inventories.GetSlot(i).SetSelected(false); //} Inventories.GetSlot(Inventories.GetSwitchedIndex(SelectedIndex)).SetSelected(false); }
void ShowInventory() { Inventories = GameManager.Inst().UiManager.InventoryScroll.GetComponent <InventoryScroll>(); Inventories.transform.SetParent(InventoryArea.transform, false); Inventories.SetSlotType(1); Inventories.ShowInventory(); for (int i = 0; i < Constants.MAXBULLETS; i++) { if (GameManager.Inst().UpgManager.BData[i].GetEquipIndex() != -1) { InventorySlot slot = Inventories.GetSlot(Inventories.GetSwitchedIndex(GameManager.Inst().UpgManager.BData[i].GetEquipIndex())); slot.EMark.SetActive(true); } } }
public void SortAsDefault() { for (int i = 0; i < GameManager.Inst().Player.MaxInventory; i++) { Player.EqData eq = GameManager.Inst().Player.GetItem(i); if (eq != null) { if (eq.UID / 100 == 6) { Sprite icon = eq.Icon; InventorySlot slot = Inventories.GetSlot(i); slot.gameObject.SetActive(true); slot.GetNotExist().SetActive(false); slot.GetExist().SetActive(true); slot.SetIcon(icon); slot.SetDisable(false); slot.SetGradeSprite(eq.Rarity); for (int j = 0; j < Constants.MAXBULLETS; j++) { if (GameManager.Inst().UpgManager.BData[j].GetEquipIndex() == Inventories.GetSwitchedIndex(i)) { slot.EMark.SetActive(true); } } } } else { Inventories.HideSlot(i); } } GameManager.Inst().Player.SortOption = (int)InventorySlot.SortOption.SYNTHESIS; Inventories.Sort(); }