using UnityEngine;
using System.Collections;
public class ActivePlayerHUDController : MonoBehaviour {
#region // Member Variable Declaration
public UILabel cardLabel;
public UISprite card1;
public UISprite card2;
public UISprite card3;
public UISprite card4;
public UISprite card5;
private TweenAlpha activePlayerHUDAlpha;
private bool isVisible;
#endregion
void Start() {
activePlayerHUDAlpha = this.GetComponent<TweenAlpha>();
EventDelegate testDelegate
= new EventDelegate
(TestMe
); Fade(activePlayerHUDAlpha, 1.0f, 0.2f, 3.0f, testDelegate);
//Fade(activePlayerHUDAlpha, 1.0f, 0.2f, 3.0f, null);
}
void Fade(TweenAlpha alpha, float fromValue, float toValue, float duration, EventDelegate test) {
TweenAlpha.Begin(gameObject, duration, toValue).onFinished.Add(test);
alpha.from = fromValue;
alpha.style = UITweener.Style.Once;
alpha
.animationCurve = new AnimationCurve
( new Keyframe
(0
.0f, 0
.0f, 1
.0f, 1
.0f
),
new Keyframe
(1
.0f, 1
.0f, 1
.0f, 1
.0f
)); }
void TestMe() {
Debug.Log("Fade called me");
Fade(activePlayerHUDAlpha, 0.2f, 1.0f, 3.0f, null);
}
}