Пример #1
0
    void Init()
    {
        if (purchased == null)
        {
            purchased = new IntGameObjectEvent();
        }
        button     = GetComponent <Button>();
        buttonText = GetComponentInChildren <Text>();

        if (upgrade == null)
        {
            Debug.Log("Button created but not provided purchasable definition");
            return;
        }

        price           = upgrade.price;
        priceMultiplier = upgrade.priceMultiplier;
        prefab          = upgrade.prefab;
        label           = upgrade.label;
    }