Hi all,
Trying to display a cooldown timer over the top of a spell button. No matter what I try, I seem to be unable to get the GUI.label infront of the GUI.button.
GUI.depth does not work, as it is all processed in the same GUI Script.
Any ideas, references or something I am missing would be a great help
Excerpt of code from ONGUI function
//Omitted Code
function OnGUI ()
{
for(var i : int = 0; i < spellIcon.Length; i++)
{
if (GUI.Button (new Rect(Screen.width/2-400,Screen.height-100,64,64),spellIcon*))*
-
{*
_ if (cooldownTimer <= 0)_
* {*
* cameraAimingScriptGO.gameObject.GetComponent(AimingRay).CastSpell();*
cooldownTimer = cooldownSpellTime*;*
* }*
* }*
* GUI.Label (new Rect(Screen.width/2-400+50,Screen.height-100+40,64,64),“1”);*
* //Cooldown Component*
_ if (cooldownTimer*>0)
{
GUI.Label (new Rect(Screen.width/2-400,Screen.height-100,64,64),cooldownCover);
GUI.skin = guiCountdown;
GUI.Label (new Rect(Screen.width/2-380,Screen.height-68,64,64),“”+cooldownTimer);
}
}
}*_
//Omitted Code