using System.Collections; using UnityEngine; using UnityEngine.UI; public class SceneFadeIn : MonoBehaviour { public Image ÆäÀ̵å¿À¹ö·¹ÀÌ; public float ÆäÀ̵å½Ã°£ = 1.5f; void Start() { StartCoroutine(ÆäÀ̵åÀÎ()); } IEnumerator ÆäÀ̵åÀÎ() { ÆäÀ̵å¿À¹ö·¹ÀÌ.color = new Color(0, 0, 0, 1); float time = 0f; while (time < ÆäÀ̵å½Ã°£) { time += Time.deltaTime; float alpha = Mathf.Lerp(1f, 0f, time / ÆäÀ̵å½Ã°£); ÆäÀ̵å¿À¹ö·¹ÀÌ.color = new Color(0, 0, 0, alpha); yield return null; } ÆäÀ̵å¿À¹ö·¹ÀÌ.color = new Color(0, 0, 0, 0); } }