- Home /
Only allow user to instantiate game object when he has a certain amount of points(money)
Hi All :) I was wondering I am making a tycoon game and I have a simple scoring script so that when ever I click on the coin it adds money.I also have two GUI buttons for my buildings which generate the coins over time. Is there a way that a user can only click on the building GUI button and instantiate the building when he has enough points?
Please remember to mark the correct answer so this question gets closed properly and the answer/helper gets his karma-reward. :o)
Answer by syclamoth · Oct 28, 2011 at 12:22 AM
Yes.
GUI.enabled = money > buildingCost;
if(GUI.button(some Rect, "build a building"))
{
// make the building.
}
Your answer
Follow this Question
Related Questions
Custom Inspector GUI, Instantiating some classes 2 Answers
Instantiating object from inventory 0 Answers
i need to destroy prefab clones 1 Answer
How to apply check on an instanced prefab 2 Answers
Instantiating GUI text after 2nd object is destroyed 1 Answer