public Rect onGUI(Rect r,BaseMenuState bms) { Rect outRect = r; outRect.y+=30f/640f; outRect.x+=20f/960f; outRect.width=250f/960f; outRect.height = 60f/640f; GUI.Box(GUIHelper.screenRect(outRect),upgradeName + " " + (getCurrentLevel()+offset).ToString() + " / " + (getMaxLevel()+offset).ToString()); outRect.x += 270f/960f; outRect.width=150f/960f; if(getCurrentLevel()<maxLevel) { GUI.enabled=true; if(bms.addButton(GUIHelper.screenRect(outRect),"Cost:" + getGoldCost().ToString())) { attemptUpgrade(); } }else{ GUI.enabled=false; bms.addButton(GUIHelper.screenRect(outRect),"MAXED OUT"); } outRect.y += outRect.height + 5f/640f; GUI.enabled=true; return outRect; }
static void Main() { Console.SetWindowSize(100, 45); Console.WindowHeight = 45; Console.BufferHeight = Console.WindowHeight; Console.WindowWidth = 100; Console.BufferWidth = Console.WindowWidth; ZooManagement.Init(); #region Menu state = new MainMenu(); Console.CursorVisible = false; while (programIsRunning) { Console.Clear(); state.PrintMenu(); GetVersion(); ReadKey(); TakeChoice(cki); } #endregion }
public Rect onGUI(Rect r, BaseMenuState bms) { Rect outRect = r; outRect.y += 30f / 640f; outRect.x += 20f / 960f; outRect.width = 250f / 960f; outRect.height = 60f / 640f; GUI.Box(GUIHelper.screenRect(outRect), upgradeName + " " + (getCurrentLevel() + offset).ToString() + " / " + (getMaxLevel() + offset).ToString()); outRect.x += 270f / 960f; outRect.width = 150f / 960f; if (getCurrentLevel() < maxLevel) { GUI.enabled = true; if (bms.addButton(GUIHelper.screenRect(outRect), "Cost:" + getGoldCost().ToString())) { attemptUpgrade(); } } else { GUI.enabled = false; bms.addButton(GUIHelper.screenRect(outRect), "MAXED OUT"); } outRect.y += outRect.height + 5f / 640f; GUI.enabled = true; return(outRect); }
public static BaseMenuState getState(GameObject go) { BaseMenuState bms = null; if (go) { bms = go.GetComponent <BaseMenuState>(); } return(bms); }
public static BaseMenuState getState(string name) { BaseMenuState bms = null; GameObject go = GameObject.Find(name); if (go) { bms = go.GetComponent <BaseMenuState>(); } return(bms); }
public static void enterStateUsingGameObject(GameObject go) { BaseMenuState bms = getState(go); string stateID = ""; if (bms) { stateID = bms.getStateID(); } if (onEnterState != null) { onEnterState(stateID); } }
public static void enterStateUsingName(string name) { BaseMenuState bms = getState(name); string stateID = ""; if (bms) { stateID = bms.getStateID(); } if (onEnterState != null) { onEnterState(stateID); } }
public Rect onGUI(Rect r,BaseMenuState bms) { Rect outRect = r; outRect.y+=30f/640f; outRect.x+=20f/960f; outRect.width=250f/960f; outRect.height = 60f/640f; GUI.Box(GUIHelper.screenRect(outRect),upgradeName); outRect.x += 270f/960f; outRect.width=150f/960f; GUI.enabled=true; if(bms.addButton(GUIHelper.screenRect(outRect),"Cost $" + costInUSD)) { attemptUpgrade(); } outRect.y += outRect.height + 5f/640f; GUI.enabled=true; return outRect; }
public Rect onGUI(Rect r, BaseMenuState bms) { Rect outRect = r; outRect.y += 30f / 640f; outRect.x += 20f / 960f; outRect.width = 250f / 960f; outRect.height = 60f / 640f; GUI.Box(GUIHelper.screenRect(outRect), upgradeName); outRect.x += 270f / 960f; outRect.width = 150f / 960f; GUI.enabled = true; if (bms.addButton(GUIHelper.screenRect(outRect), "Cost $" + costInUSD)) { attemptUpgrade(); } outRect.y += outRect.height + 5f / 640f; GUI.enabled = true; return(outRect); }