can i change a sprite opacity from 0% to 100% during runtime after 2 sec of starting the game ?
maybe something like this:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class ChangeAlpha : MonoBehaviour
{
Image image;
IEnumerator Start()
{
yield return new WaitForSeconds(2);
Color c = image.color;
c.a = 1;
image.color = c;
}
}
You can change the Image opacity like this way…
public class opacity : MonoBehaviour {
public Image img;
// Use this for initialization
void Start ()
{
StartCoroutine ("Wait");
}
IEnumerator Wait()
{
yield return new WaitForSeconds (2.0f);
img.color = new Color (1.0f,1.0f,1.0f,1.0f);
StopCoroutine ("Wait");
}
}