Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function OnMouseOver () {
- renderer.material.color = Color.green;
- if (Input.GetMouseButtonDown(1)){
- isClicked = true;
- }
- }
- function OnMouseExit () {
- renderer.material.color = Color.white;
- DestroyGUI ();
- }
- function OnGUI () {
- if (isClicked == true) {
- if (active_creating == false) {
- if (GUI.Button(Rect(650,10,250,50),"Производство товара")) {
- active_creating = true;
- Create ();
- }
- }
- if (active_creating == true) {
- if (GUI.Button(Rect(650,10,250,50),"Остановить производство")){
- active_creating = false;
- }
- }
- GUI.Button(Rect(650,60,250,50),"Товара на складе: " +tovar);
- GUI.Button(Rect(650,110,250,50),"Максимум товара на складе " +max_sklad);
- if (tovar > 0) {
- if (GUI.Button(Rect(650,160,250,50),"Продать товар")){
- GlobalVars.money += cell_price * tovar;
- tovar = 0;
- }
- }
- if (experience >= level_1_exp_need && level_1_act == false && level_2_act == false){
- if (GUI.Button(Rect(650,210,250,50),"Улучшить здание")){
- time_for_creating -= 1.5;
- price_creating -= 10;
- level_1_act = true;
- max_sklad += 5;
- }
- }
- if (experience >= level_2_exp_need && level_1_act == true && level_2_act == false) {
- if (GUI.Button(Rect(650,210,250,50),"Улучшить здание")){
- time_for_creating -= 1.5;
- price_creating -= 10;
- level_2_act = true;
- max_sklad += 5;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement