Created
July 27, 2015 12:40
-
-
Save Redhucules/a1268b7da3aaf880aacf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.UI; | |
public class PlayerBattleUI : MonoBehaviour { | |
//private GameObject BattleUICanvas; | |
public Image ENGauge; | |
public Image ENGaugeOBRequire; | |
public PlayerStatus Status; | |
void Awake () | |
{ | |
if (GameObject.Find("BattleUICanvas/ENGauge") != null) | |
{ | |
ENGauge = GameObject.Find("BattleUICanvas/ENGauge").GetComponent <Image> (); | |
} | |
if (GameObject.Find("BattleUICanvas/ENGaugeOBRequire") != null) | |
{ | |
ENGaugeOBRequire = GameObject.Find("BattleUICanvas/ENGaugeOBRequire").GetComponent <Image> (); | |
} | |
Status = GetComponent<PlayerStatus> (); | |
} | |
// Use this for initialization | |
void Start () | |
{ | |
if (ENGaugeOBRequire != null) | |
{ | |
ENGaugeOBRequire.fillAmount = Status.OBStartCost / Status.MaxEnergy; | |
} | |
} | |
// Update is called once per frame | |
void Update () | |
{ | |
if (ENGauge != null) | |
{ | |
ENGauge.fillAmount = Status.CurrentEnergy / Status.MaxEnergy; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment