Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class GUIScripts : MonoBehaviour {
- public bool abilityBarActive = true;
- // Use this for initialization
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- }
- void OnGUI() {
- PlayerScript callPlayerScriptInterface = gameObject.GetComponent<PlayerScript>();
- GUI.Box(new Rect(10, 10, callPlayerScriptInterface.playerCurHealth / callPlayerScriptInterface.playerMaxHealth, 10), callPlayerScriptInterface.playerCurHealth + "/" + callPlayerScriptInterface.playerMaxHealth);
- #region Abilitybar
- if(abilityBarActive == true) {
- Cooldown callPlayerCD = gameObject.GetComponent<Cooldown>();
- GUI.Box(new Rect(750, 500 , 350, 100),"Ability bar");
- if (callPlayerCD.qCooldown == 0 ) {
- if(GUI.Button(new Rect(830, 525, 40, 40),"Q")) {
- callPlayerScriptInterface.UseQAbility();
- }
- }
- if (callPlayerCD.qCooldown == 0 ) {
- if (GUI.Button(new Rect(880, 525, 40, 40),"W")){
- callPlayerScriptInterface.UseWAbility();
- }
- }
- if (callPlayerCD.qCooldown == 0 ) {
- if(GUI.Button(new Rect(930, 525, 40, 40),"E")){
- callPlayerScriptInterface.UseEAbility();
- }
- }
- if (callPlayerCD.qCooldown == 0 ) {
- if(GUI.Button(new Rect(980, 525, 40, 40),"R")){
- callPlayerScriptInterface.UseRAbility();
- }
- }
- else {
- }
- #endregion
- }
- }
- }
Add Comment
Please, Sign In to add comment