Esempio n. 1
0
    void purchase()
    {
        //If it is clickable, then you can buy it
        if (!clicking_button.interactable)
        {
            return;
        }

        //Subtract value from global economy
        if (!economyManager.buy(actual_cost))
        {
            return;
        }

        //Add number of elements
        number_of_elements++;

        //Update total value generated by the objects
        wps_total = wps_per_unit * number_of_elements;

        //Augment the price
        actual_cost *= (1 + augment_ratio);

        //Update the text
        inner_text[0].text = object_name;
        inner_text[1].text = "" + actual_cost.ToString("F1");
        inner_text[2].text = "" + number_of_elements;
    }