Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.57 KB | None | 0 0
  1. #WTF is this for?
  2. using UnityEngine;
  3. #!/bin/sh
  4. using System.Collections;
  5. static class ButtonHelper
  6. {
  7. #
  8.  
  9.     public static Rect CreateBUttonRow (float x, float y)
  10.     {
  11. # halt - halt the system
  12.        
  13.         float width = (((float)Screen.width) / 5.0f) - 15;
  14.        
  15. #
  16.         float height = (((float)Screen.height) / 2.0f) - 15;
  17.    
  18.         return new Rect (x + 15, y + 15, width, height);
  19. PATH=/sbin:/bin ; export PATH      
  20.     }
  21. echo "Initiating system halt."
  22. halt       
  23.    
  24. }
  25. #
  26. public class ButtonHelperBottom
  27. {
  28.     public static Rect CreateBUttonRow2 (float x)
  29.     {
  30. # end of /etc/init.d/halt      
  31.         float width = (((float)Screen.width) / 5.0f) - 15;
  32.        
  33.         float height = (((float)Screen.height) / 2.0f) - 15;
  34.        
  35.         float y = (height);
  36.        
  37.         return new Rect (x + 15, y + 15, width, height);
  38.        
  39.     }
  40. }
  41.  
  42.  
  43. public class WeaponsModeMenu : MonoBehaviour
  44. {
  45.  
  46.     bool AnotherButton (ref Rect rect, string text)
  47.     {
  48.         bool buttonValue = GUI.Button (rect, text);
  49.         rect.x += rect.width;
  50.         return buttonValue;
  51.     }
  52.  
  53.     void OnGUI ()
  54.     {
  55.        
  56.         //top row reference rect
  57.         Rect topRowrect = ButtonHelper.CreateBUttonRow (0, 0);
  58.        
  59.         bool wasPressedC = AnotherButton (ref topRowrect, "Campaign");
  60.         if (wasPressedC) {
  61.             Application.LoadLevel ("Testmap Scene");
  62.         }
  63.        
  64.         bool wasPressedM = AnotherButton (ref topRowrect, "Multiplayer");
  65.         if (wasPressedM) {
  66.             Application.LoadLevel ("MultiPlayer Menu");
  67.         }
  68.        
  69.         bool wasPressedO = AnotherButton (ref topRowrect, "Options");
  70.         if (wasPressedO) {
  71.             Application.LoadLevel ("Options Menu");
  72.         }
  73.        
  74.         bool wasPressedQ = AnotherButton (ref topRowrect, "Quit");
  75.         if (wasPressedQ) {
  76.             Application.Quit ();
  77.         }
  78.        
  79.         bool wasPressedC1 = AnotherButton (ref topRowrect, "Campaign");
  80.         if (wasPressedC1) {
  81.             Application.LoadLevel ("Testmap Scene");
  82.         }
  83.        
  84.        
  85.         //bottom row reference rect
  86.         Rect bottomRowrect = ButtonHelperBottom.CreateBUttonRow2 (0);
  87.        
  88.         bool wasPressedx = AnotherButton (ref bottomRowrect, "Campaign");
  89.         if (wasPressedx) {
  90.             Application.LoadLevel ("Testmap Scene");
  91.         }
  92.        
  93.         bool wasPressedy = AnotherButton (ref bottomRowrect, "Campaign");
  94.         if (wasPressedy) {
  95.             Application.LoadLevel ("Testmap Scene");
  96.         }
  97.        
  98.         bool wasPressedz = AnotherButton (ref bottomRowrect, "Campaign");
  99.         if (wasPressedz) {
  100.             Application.LoadLevel ("Testmap Scene");
  101.         }
  102.        
  103.         bool wasPressed1 = AnotherButton (ref bottomRowrect, "Campaign");
  104.         if (wasPressed1) {
  105.             Application.LoadLevel ("Testmap Scene");
  106.         }
  107.        
  108.         bool wasPressed2 = AnotherButton (ref bottomRowrect, "Campaign");
  109.         if (wasPressed2) {
  110.             Application.LoadLevel ("Testmap Scene");
  111.         }
  112.     }
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement