Ejemplo n.º 1
0
    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();
    }