daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2.  
  3.  
  4.  
  5. using System.Collections;
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13. public class GUIScripts : MonoBehaviour {
  14.  
  15.  
  16.  
  17.     public bool abilityBarActive = true;
  18.  
  19.     // Use this for initialization
  20.     void Start () {
  21.        
  22.     }
  23.  
  24.     // Update is called once per frame
  25.     void Update () {
  26.        
  27.     }
  28.     void OnGUI() {
  29.         PlayerScript callPlayerScriptInterface = gameObject.GetComponent<PlayerScript>();
  30.         GUI.Box(new Rect(10, 10, callPlayerScriptInterface.playerCurHealth / callPlayerScriptInterface.playerMaxHealth, 10), callPlayerScriptInterface.playerCurHealth + "/" + callPlayerScriptInterface.playerMaxHealth);
  31.        
  32.         #region Abilitybar
  33.         if(abilityBarActive == true) {
  34.  
  35.             Cooldown callPlayerCD = gameObject.GetComponent<Cooldown>();
  36.            
  37.             GUI.Box(new Rect(750, 500 , 350, 100),"Ability bar");
  38.             if (callPlayerCD.qCooldown == 0 ) {
  39.                 if(GUI.Button(new Rect(830, 525, 40, 40),"Q")) {
  40.                     callPlayerScriptInterface.UseQAbility();
  41.                 }
  42.             }
  43.             if (callPlayerCD.qCooldown == 0 ) {
  44.                 if (GUI.Button(new Rect(880, 525, 40, 40),"W")){
  45.                     callPlayerScriptInterface.UseWAbility();
  46.                 }
  47.             }
  48.             if (callPlayerCD.qCooldown == 0 ) {
  49.                 if(GUI.Button(new Rect(930, 525, 40, 40),"E")){
  50.                     callPlayerScriptInterface.UseEAbility();
  51.                 }
  52.             }
  53.             if (callPlayerCD.qCooldown == 0 ) {
  54.                 if(GUI.Button(new Rect(980, 525, 40, 40),"R")){
  55.                     callPlayerScriptInterface.UseRAbility();
  56.                 }
  57.             }  
  58.         else  {
  59.                
  60.         }
  61.             #endregion
  62. }
  63. }
  64. }
RAW Paste Data
Top