using UnityEngine;
using System.Collections;
public class LevelTitle : MonoBehaviour {
UILabel TitleLabel;
// Use this for initialization
void Start () {
TitleLabel = GetComponent<UILabel>();
//TitleLabel.alpha = 0F;
TitleLabel.MakePixelPerfect ();
this.transform.localPosition = new Vector3
(240,
-240,
0); TitleLabel.alpha = 1F;
StartCoroutine ("sequence");
}
void OnLevelWasLoaded()
{
StopAllCoroutines();
TitleLabel = GetComponent<UILabel>();
// TitleLabel.alpha = 0F;
TitleLabel.MakePixelPerfect ();
this.transform.localPosition = new Vector3
(240,
-240,
0); TitleLabel.alpha = 1F;
StartCoroutine ("sequence");
}
IEnumerator sequence()
{
yield return new WaitForSeconds
(4F
); GetComponent<TweenPosition>().enabled = true; // this move the label out of the screen
yield return new WaitForSeconds
(2F
); TitleLabel.alpha = 0F;
}
}