BlackScreen.Update C# (CSharp) 메소드

Update() 공개 메소드

public Update ( ) : void
리턴 void
    void Update()
    {
        if (flashRequested) {
            // Check if fading to or from black
            if (toBlack)
            {
                // Continue fading until image is almost black
                if (image.color.a < 0.995) {
                    FadeToBlack ();
                }
                // Once image is almost black, set to pure black and delay slightly
                else {
                    image.color = new Color (0.0f, 0.0f, 0.0f, 1.0f);
                    toBlack = false;
                    delay = Time.time + 0.5f;
                }
            } else if (Time.time > delay)
            {
                // After brief delay, fade black to clear
                if (image.color.a > 0.005)
                {
                    FadeToClear ();
                }
                // When image is almost fully clear, disable it
                else
                {
                    image.enabled = false;
                    flashRequested = false;
                }
            }
        }
    }