Author Topic: Label Displayed on the editor but not displayed in the standalone  (Read 2645 times)

aidji

  • Guest
Hi,
I have a TitleLabel that is displayed few second when a new scene is loaded
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class LevelTitle : MonoBehaviour {
  5.         UILabel TitleLabel;
  6.        
  7.         // Use this for initialization
  8.         void Start () {
  9.                 TitleLabel = GetComponent<UILabel>();
  10.                 //TitleLabel.alpha = 0F;
  11.                 TitleLabel.MakePixelPerfect ();
  12.                 this.transform.localPosition = new Vector3 (240,-240,0);
  13.                 TitleLabel.alpha = 1F;
  14.                 StartCoroutine ("sequence");
  15.         }
  16.         void OnLevelWasLoaded()
  17.         {
  18.                 StopAllCoroutines();
  19.                 TitleLabel = GetComponent<UILabel>();
  20.         //      TitleLabel.alpha = 0F;
  21.                 TitleLabel.MakePixelPerfect ();
  22.                 this.transform.localPosition = new Vector3 (240,-240,0);
  23.                 TitleLabel.alpha = 1F;
  24.                 StartCoroutine ("sequence");
  25.         }
  26.         IEnumerator sequence()
  27.         {
  28.                 yield return new WaitForSeconds(4F);
  29.                 GetComponent<TweenPosition>().enabled = true; // this move the label out of the screen
  30.                 yield return new WaitForSeconds(2F);
  31.                 TitleLabel.alpha = 0F;
  32.                
  33.         }
  34. }
  35.  

-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?

aidji

  • Guest
Re: Label Displayed on the editor but not displayed in the standalone
« Reply #1 on: October 15, 2013, 11:36:02 PM »
I found my problem

I had the panel bool sort by depth to false, in the inspector it was rendering correctly ( all the widget Z=0)
but in the standalone it rendered differently, then i set sort depth to true and all was correct