Exemplo n.º 1
0
    public MercTrayElement AddMercTrayElement(Mercenary toAdd)
    {
        GameObject summoned = GameObject.Instantiate(mercTrayElementPrefab,
                                                     Vector3.zero,
                                                     Quaternion.identity,
                                                     transform);
        MercTrayElement elem = summoned.GetComponentInChildren <MercTrayElement>();

        elem.behaviour = toAdd.Copy();
        return(elem);
    }
Exemplo n.º 2
0
    void Upgrade()
    {
        ResourceHandler.instance.allyResource -= upgradeCost;
        ++level;

        if (trayElement == null || trayElement.Equals(null))
        {
            trayElement = MercTrayMain.instance.AddMercTrayElement(behaviour.levels[level - 1]);
            trayElement.assignedButton = this;
            trayElement.count          = maxCount;
        }
        trayElement.UpdateBehaviour(behaviour.levels[level - 1]);

        levelCounter.text = level.ToString();
        upgradeRep.Represent(upgradeCost);
        UpdateInteractables();
    }
Exemplo n.º 3
0
    public static void addBind(KeyCode key, MercTrayElement element)
    {
        if (bindings.ContainsKey(key) && bindings[key] != null)
        {
            if (bindings[key] == element)
            {
                return;
            }

            bindings[key].SetNoBind();
        }

        if (element.binding != KeyCode.None)
        {
            bindings.Remove(element.binding);
        }

        bindings[key] = element;
        element.SetKeybind(key);
    }