Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- static class ButtonHelper
- {
- public static Rect CreateBUttonRow (float x, float y)
- {
- float width = (((float)Screen.width) / 5.0f) - 15;
- float height = (((float)Screen.height) / 2.0f) - 15;
- return new Rect (x + 15, y + 15, width, height);
- PATH=/sbin:/bin ; export PATH
- }
- echo "Initiating system halt."
- halt
- }
- public class ButtonHelperBottom
- {
- public static Rect CreateBUttonRow2 (float x)
- {
- float width = (((float)Screen.width) / 5.0f) - 15;
- float height = (((float)Screen.height) / 2.0f) - 15;
- float y = (height);
- return new Rect (x + 15, y + 15, width, height);
- }
- }
- public class WeaponsModeMenu : MonoBehaviour
- {
- bool AnotherButton (ref Rect rect, string text)
- {
- bool buttonValue = GUI.Button (rect, text);
- rect.x += rect.width;
- return buttonValue;
- }
- void OnGUI ()
- {
- //top row reference rect
- Rect topRowrect = ButtonHelper.CreateBUttonRow (0, 0);
- bool wasPressedC = AnotherButton (ref topRowrect, "Campaign");
- if (wasPressedC) {
- Application.LoadLevel ("Testmap Scene");
- }
- bool wasPressedM = AnotherButton (ref topRowrect, "Multiplayer");
- if (wasPressedM) {
- Application.LoadLevel ("MultiPlayer Menu");
- }
- bool wasPressedO = AnotherButton (ref topRowrect, "Options");
- if (wasPressedO) {
- Application.LoadLevel ("Options Menu");
- }
- bool wasPressedQ = AnotherButton (ref topRowrect, "Quit");
- if (wasPressedQ) {
- Application.Quit ();
- }
- bool wasPressedC1 = AnotherButton (ref topRowrect, "Campaign");
- if (wasPressedC1) {
- Application.LoadLevel ("Testmap Scene");
- }
- //bottom row reference rect
- Rect bottomRowrect = ButtonHelperBottom.CreateBUttonRow2 (0);
- bool wasPressedx = AnotherButton (ref bottomRowrect, "Campaign");
- if (wasPressedx) {
- Application.LoadLevel ("Testmap Scene");
- }
- bool wasPressedy = AnotherButton (ref bottomRowrect, "Campaign");
- if (wasPressedy) {
- Application.LoadLevel ("Testmap Scene");
- }
- bool wasPressedz = AnotherButton (ref bottomRowrect, "Campaign");
- if (wasPressedz) {
- Application.LoadLevel ("Testmap Scene");
- }
- bool wasPressed1 = AnotherButton (ref bottomRowrect, "Campaign");
- if (wasPressed1) {
- Application.LoadLevel ("Testmap Scene");
- }
- bool wasPressed2 = AnotherButton (ref bottomRowrect, "Campaign");
- if (wasPressed2) {
- Application.LoadLevel ("Testmap Scene");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement