Beispiel #1
0
    public void UpdateAbilities(ref IHardware[] activeHardwareList)
    {
        for (int i = 0; i < activeHardwareList.Length; i++)
        {
            IHardware activeHardware = activeHardwareList[i];
            Sprite    activeHardwareBubSprite;

            if (activeHardware == null)
            {
                activeHardwareBubSprite    = emptyAbilityBub;
                abilityBubImages[i].sprite = activeHardwareBubSprite;
                abilityMomentumCounters[i].SetActive(false);

                if (cooldownOverlays[i].enabled == true)
                {
                    cooldownOverlays[i].enabled = false;
                }
            }
            else
            {
                HardwareType activeHardwareType = activeHardware.Type;

                activeHardwareBubSprite    = DataAssociations.GetHardwareTypeBubImage(activeHardwareType);
                abilityBubImages[i].sprite = activeHardwareBubSprite;
                abilityMomentumCounters[i].SetActive(true);

                activeHardware.CooldownPercentUpdater  = null;
                activeHardware.CooldownPercentUpdater += GenerateCooldownPercentUpdater(i);

                activeHardware.CooldownDurationUpdater  = null;
                activeHardware.CooldownDurationUpdater += GenerateCooldownDurationUpdater(i);
            }
        }
    }
Beispiel #2
0
    void UpdateEquippedGear(InventoryData inventory)
    {
        for (int i = 0; i < inventory.EquippedActiveHardware.Length; i++)
        {
            HardwareType equippedHardware = inventory.EquippedActiveHardware[i];
            activeHardwareImages[i].sprite = DataAssociations.GetHardwareTypeBubImage(equippedHardware);
        }

        for (int i = 0; i < inventory.EquippedPassiveHardware.Length; i++)
        {
            HardwareType equippedHardware = inventory.EquippedPassiveHardware[i];
            passiveHardwareImages[i].sprite = DataAssociations.GetHardwareTypeBubImage(equippedHardware);
        }
    }
    void DisplayAndActivateDiscoveredHardware()
    {
        for (int i = 0; i < discoverableHardwareTypes.Length; i++)
        {
            HardwareType hardwareType = discoverableHardwareTypes[i];
            if (InventoryController.HasDiscoveredHardware(hardwareType))
            {
                Sprite discoverableHardwareBubImage = DataAssociations.GetHardwareTypeBubImage(hardwareType);
                hardwareInventoryImages[i].sprite = discoverableHardwareBubImage;

                EventTrigger trigger = hardwareInventoryEventTriggers[i];

                AssignDragEventListeners(trigger, discoverableHardwareBubImage, hardwareType);
            }
        }
    }