BlackScreen.FadeToBlack C# (CSharp) Method

FadeToBlack() public method

public FadeToBlack ( ) : void
return void
    public void FadeToBlack()
    {
        // Lerp the colour of the panel between itself and black
        image.color = Color.Lerp (image.color, Color.black, fadeInSpeed * Time.deltaTime);
    }

Usage Example

Exemplo n.º 1
0
    public void FloorTransition()
    {
        BlackScreen blackScreenComp = blackScreen.GetComponent <BlackScreen>();

        ladderState = LadderStates.Transition;
        StartCoroutine(blackScreenComp.FadeToBlack(0.5f, 0.0f));
        StartCoroutine(blackScreenComp.FadeFromBlack(0.5f, 1.0f));
        Invoke("NextFloor", 1.0f);
        string floorText = "Floor " + (GameObject.Find("TowerManager").GetComponent <LevelManager>().currentFloor + 1).ToString(); // floor + 1 because NextFloor gets called too late.

        StartCoroutine(blackScreenComp.FadeInText(floorText, 0.5f, 1.5f));
        StartCoroutine(blackScreenComp.FadeOutText(0.5f, 2.5f));
    }
All Usage Examples Of BlackScreen::FadeToBlack