2017-06-26 01:36:49 +08:00
|
|
|
|
/// Credit SimonDarksideJ
|
|
|
|
|
/// Sourced from my head
|
|
|
|
|
|
2017-08-02 17:21:45 +08:00
|
|
|
|
namespace UnityEngine.UI.Extensions.Examples
|
2017-06-26 01:36:49 +08:00
|
|
|
|
{
|
|
|
|
|
[RequireComponent(typeof(SoftMaskScript))]
|
|
|
|
|
public class CooldownEffect_SAUIM : MonoBehaviour {
|
|
|
|
|
|
|
|
|
|
public CooldownButton cooldown;
|
|
|
|
|
private SoftMaskScript sauim;
|
|
|
|
|
|
|
|
|
|
// Use this for initialization
|
|
|
|
|
void Start() {
|
|
|
|
|
if (cooldown == null)
|
|
|
|
|
{
|
|
|
|
|
Debug.LogError("Missing Cooldown Button assignment");
|
|
|
|
|
}
|
|
|
|
|
sauim = GetComponent<SoftMaskScript>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update() {
|
|
|
|
|
sauim.CutOff = Mathf.Lerp(0,1, cooldown.CooldownTimeElapsed / cooldown.CooldownTimeout);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|