public override void onGUI() { float offsetX = transform.position.x; float offsetY = transform.position.y; if (backgroundTexture) { GUI.DrawTexture(GUIHelper.screenRect(0, 0, 1, 1), backgroundTexture, ScaleMode.StretchToFill); } GUI.skin = guiSkin0; //draw a button which will increase the graphics quality if (addButton(GUIHelper.screenRect(offsetX - 0.15f, offsetY - .15f, .3f, .1f), restartSTR)) { MenuStateManager.enterStateUsingGameObject(null); unapuseGame(); //load the first level. Application.LoadLevel(Application.loadedLevel); } //draw a button that will decrease the graphics quality if (addButton(GUIHelper.screenRect(offsetX - 0.15f, offsetY, .3f, .1f), resumeSTR)) { MenuStateManager.enterStateUsingGameObject(null); unapuseGame(); } if (addButton(GUIHelper.screenRect(offsetX - 0.15f, offsetY + .15f, .3f, .1f), mainMenuSTR)) { MenuStateManager.enterStateUsingGameObject(null); unapuseGame(); //load the first level. Application.LoadLevel(levelSceneIndex); } }
public void swapObjects(GameObject go) { MenuStateManager.enterStateUsingGameObject(go); }