예제 #1
0
        // TODO: In the future, may add a new attribute that allows for bonus effects when equipping certain gear
        // This may need to be a data type

        // Compares to see if two ItemDatas are the same
        public override bool Equals(object other)
        {
            GearData compareTo = (GearData)other;

            if (compareTo.gearSprite == gearSprite &&
                compareTo.gearName == gearName &&
                compareTo.gearDescription == gearDescription &&
                compareTo.typeOfGear == typeOfGear)
            {
                return(true);
            }
            return(false);
        }
예제 #2
0
        // We set up all of the variables needed for the gear menu
        private void InitializeGearMenu()
        {
            gearMenuObject.SetActive(true);
            currentMenuParent = gearMenuObject.transform.GetChild(0).GetChild(0).GetChild(0);

            int currGearIndex = 0;

            while (currGearIndex < playerInventory.GetGearInventorySize())
            {
                GearData currGear = playerInventory.GetGearAtIndex(currGearIndex).SpecifiedGear;
                currentMenuParent.GetChild(currGearIndex).GetComponent <TextMeshProUGUI>().text = currGear.gearName;
                ++currGearIndex;
            }
            // For the rest of the items in the list, we clear them from the screen
            while (currGearIndex < currentMenuParent.childCount)
            {
                currentMenuParent.GetChild(currGearIndex).GetComponent <TextMeshProUGUI>().text = "";
                ++currGearIndex;
            }

            currentState = MenuStates.GEAR;
        }
예제 #3
0
 public InventoryGear(GearData newGear, int quantity)
 {
     this.specifiedGear = newGear;
     this.quantity      = quantity;
 }