Example #1
0
    void Update()
    {
        MinionTemplateManager mtm  = Core.GetMinionTemplateManager();
        List <MinionTemplate> list = mtm.GetMinionList(slot.GetSlotType());

        MinionTemplate dropdownSelection = mtm.GetMinionList(slot.GetSlotType()) [minionSelector.value];
        Minion         currentSelection  = Core.GetPlayerProfile().rosters[0].minions [(int)slot];

        if (currentSelection.template != dropdownSelection)
        {
            for (int i = 0; i < list.Count; i++)
            {
                if (list [i] == currentSelection.template)
                {
                    minionSelector.value = i;
                    return;
                }
            }
        }
    }
Example #2
0
    public void SelectMinion(int iSelection)
    {
        Minion oldMinion = Core.GetPlayerProfile().rosters [0].GetMinion(slot);

        if (oldMinion != null)
        {
            Destroy(oldMinion.gameObject);
        }

        MinionTemplateManager mtm = Core.GetMinionTemplateManager();
        Minion minion             = Core.GetPlayerProfile().rosters [0].SetMinion(slot, mtm.GetMinionList(slot.GetSlotType()) [iSelection]);

        icon.sprite      = minion.template.icon;
        description.text = minion.template.debugDescriptionText;

        if (slot.GetSlotType() != MinionSlotType.SUPPORT)
        {
            statBlock.text = "HP: " + minion.template.fMaxHealth + ", Damage: " + minion.template.damage.fAmount + ", Attack Speed: " + (1.0f / minion.template.fAttackInterval);
        }
    }