Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        behaviour.Initialize(this);

        upgradeRep.Represent(upgradeCost);

        upgradeObj        = new ButtonBase(parentCanvas, upgradeButton, TransactionButton.upgradeKey, (RectTransform)transform, false);
        upgradeObj.press += Upgrade;
    }
Exemplo n.º 2
0
    void Start()
    {
        behaviour.Initialize(this);
        upgradeRep.Represent(upgradeCost);

        upgradeBehaviour = GetComponent <UpgradeBehaviour>();

        transactionObj = new ButtonBase(parentCanvas, transactionButton, buyKey, (RectTransform)transform);

        if (upgradeBehaviour == null || upgradeBehaviour.Equals(null))
        {
            upgradeObj = null;
        }
        else
        {
            upgradeObj = new ButtonBase(parentCanvas, upgradeButton, upgradeKey, (RectTransform)transform);
        }

        if (upgradeObj != null)
        {
            upgradeObj.press += Upgrade;
        }

        transactionObj.press += DoTransaction;

        interactable      = level > 0 && !locked;
        levelCounter.text = level.ToString();

        upgradeBehaviour = GetComponent <UpgradeBehaviour>();

        costRep.Represent(cost);
        rewardRep.Represent(returnValue);

        if (upgradeObj == null)
        {
            upgradeable = false;
            upgradeButton.transform.parent.gameObject.SetActive(false);

            interactable = false;
            levelCounter.transform.parent.gameObject.SetActive(false);
        }
    }
Exemplo n.º 3
0
 void Update()
 {
     representer.Represent(resource_internal, true);
     Plate.BUY_ONE_PLATE = Input.GetKeyDown(Plate.buyKey);
 }