Hi,
I have a TitleLabel that is displayed few second when a new scene is loaded
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;
}
}
-when I run my menu, i click on a button it load my scene1, label is displayed, in inspector and standalone.
-i finish scene 1, scene 2 is loaded, in the editor label is working correctly, then i build it and the same label is not displayed.
any idea?