Skip to content

Instantly share code, notes, and snippets.

@Lkledu
Created February 13, 2020 23:46
Show Gist options
  • Save Lkledu/e17e4f70bc9ded1e9238d7bb7bb7d19f to your computer and use it in GitHub Desktop.
Save Lkledu/e17e4f70bc9ded1e9238d7bb7bb7d19f to your computer and use it in GitHub Desktop.
FadeIn screen
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class fadeIn : MonoBehaviour
{
Image img;
//m_Group.alpha = (Mathf.Sin(Time.time * m_SmoothTime)+ 1.0f) * 0.5f;
void Start()
{
img = GetComponent<Image>();
img.color = Color.black;
}
void Update()
{
img.color = Color.Lerp(Color.black, Color.white, Time.time * 0.5f);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment