コード例 #1
0
    private void SetupAbilityButtons()
    {
        AbilityButton[] abilityButtons = FindObjectsOfType <AbilityButton>();
        HackerLoadout   currentLoadout = hacker.GetHackerLoadout();

        foreach (AbilityButton abilityButton in abilityButtons)
        {
            switch (abilityButton.GetWhichAbility())
            {
            case "rig":
                HackerMod rigMod = currentLoadout.GetRigMod();
                abilityButton.SetupAbility(rigMod);
                break;

            case "neuralImplant":
                HackerMod neuralImplantMod = currentLoadout.GetNeuralImplantMod();
                abilityButton.SetupAbility(neuralImplantMod);
                break;

            case "uplink":
                HackerMod uplinkMod = currentLoadout.GetUplinkMod();
                abilityButton.SetupAbility(uplinkMod);
                break;
            }
        }
    }
コード例 #2
0
    private void SetupActiveHackerSlots()
    {
        activeHackerSlotBtns = new List <LoadoutSlotBtn>();
        activeHackerSlotBtns.AddRange(hackerModSlots); // Always need these three

        HackerLoadout hackerLoadout = FindObjectOfType <PlayerData>().GetCurrentHacker().GetHackerLoadout();
        HackerMod     neuralImplant = hackerLoadout.GetNeuralImplantMod();

        switch (neuralImplant.GetCurrentLevelSlotCount())
        {
        case 1:
            wetware1SlotHolder.SetActive(true);
            wetware2SlotHolder.SetActive(false);
            wetware3SlotHolder.SetActive(false);
            activeHackerSlotBtns.AddRange(wetware1Slots);
            break;

        case 2:
            wetware1SlotHolder.SetActive(false);
            wetware2SlotHolder.SetActive(true);
            wetware3SlotHolder.SetActive(false);
            activeHackerSlotBtns.AddRange(wetware2Slots);
            break;

        case 3:
            wetware1SlotHolder.SetActive(false);
            wetware2SlotHolder.SetActive(false);
            wetware3SlotHolder.SetActive(true);
            activeHackerSlotBtns.AddRange(wetware3Slots);
            break;
        }

        HackerMod rig = hackerLoadout.GetRigMod();

        switch (rig.GetCurrentLevelSlotCount())
        {
        case 1:
            software1SlotHolder.SetActive(true);
            software2SlotHolder.SetActive(false);
            software3SlotHolder.SetActive(false);
            activeHackerSlotBtns.AddRange(software1Slots);
            break;

        case 2:
            software1SlotHolder.SetActive(false);
            software2SlotHolder.SetActive(true);
            software3SlotHolder.SetActive(false);
            activeHackerSlotBtns.AddRange(software2Slots);
            break;

        case 3:
            software1SlotHolder.SetActive(false);
            software2SlotHolder.SetActive(false);
            software3SlotHolder.SetActive(true);
            activeHackerSlotBtns.AddRange(software3Slots);
            break;
        }

        HackerMod uplink = hackerLoadout.GetUplinkMod();

        switch (uplink.GetCurrentLevelSlotCount())
        {
        case 1:
            chipset1SlotHolder.SetActive(true);
            chipset2SlotHolder.SetActive(false);
            chipset3SlotHolder.SetActive(false);
            activeHackerSlotBtns.AddRange(chipset1Slots);
            break;

        case 2:
            chipset1SlotHolder.SetActive(false);
            chipset2SlotHolder.SetActive(true);
            chipset3SlotHolder.SetActive(false);
            activeHackerSlotBtns.AddRange(chipset2Slots);
            break;

        case 3:
            chipset1SlotHolder.SetActive(false);
            chipset2SlotHolder.SetActive(false);
            chipset3SlotHolder.SetActive(true);
            activeHackerSlotBtns.AddRange(chipset3Slots);
            break;
        }

        foreach (LoadoutSlotBtn button in activeHackerSlotBtns)
        {
            button.SetupButton();
        }
    }