Skip to content

Instantly share code, notes, and snippets.

@jcordeiro67
Created January 23, 2017 20:07
Show Gist options
  • Select an option

  • Save jcordeiro67/23e00e79e620d852656d2023b46ad307 to your computer and use it in GitHub Desktop.

Select an option

Save jcordeiro67/23e00e79e620d852656d2023b46ad307 to your computer and use it in GitHub Desktop.
Alternate Code Adding Fade Transitions
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class UIFadeIn : MonoBehaviour {
public float fadeInDelay;
void Start () {
GetComponent <Image>().CrossFadeAlpha (0, fadeInDelay, true);
}
void Update(){
if(Time.timeSinceLevelLoad > fadeInDelay){
gameObject.SetActive (false);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment