using System.Collections; using System.Collections.Generic; using System.Threading.Tasks; using UnityEngine; using UnityEngine.UI; public class ScreenRed : MonoBehaviour { public static ScreenRed instance; private Image red; public Color redColor; private Color defaultColor; // Start is called before the first frame update void Start() { instance = this; red = GameObject.Find("Canvas/ScreenRed").GetComponent(); defaultColor = red.color; } // Update is called once per frame void Update() { } public async void ShowRed() { await ScreenIsRedingAsync(); } private async Task ScreenIsRedingAsync() { red.color = Color.Lerp(defaultColor, redColor, 0.5f); await Task.Delay(300); // ΅Θ΄ύ300ΊΑΓλ red.color = defaultColor; } }