The Introduction

This easy-to-use script will allow you to fade in or out your screen with only one line of code, so all you need is to write:

Fader .Instance .FadeIn() .LoadLevel(1) .FadeOut();

It's very easy, but on the other hand, you will get enough strong possibilities. You can setup colors, transparency, speed of effect and delays before it starts in the Inspector panel. You can subscribe on events and get notifications when effects will start or complete.

This asset works well on Free and Pro Unity, suitable for Web, Standalone, Android and iOS platform. And all this takes less then 10kb on your drive and costs less then your morning coffee.

What is more: you'll get 2 extra scripts that will allow you to fade your screen with squares or stripes effect, and of course you can also setup their additional parameters, such as number of stripes or squares and direction of effect.

The Details
Unity 3D Screen Fader asset

Asset's Features

Makes any fading with one line of code

Customizable Screen Transitions

You can customize screen fading with different effects. Or change dynamicaly fading color at runtime.

Game Objects Fading

Hide or show 2D/3D GameObject at runtime in the simplest way:
Fader.Instance.FadeIn( YourGameObject );

UI Elements Fading

This asset package also supports fading of UI elements that were introduced in Unity 5

Call Actions

Call such actions as LoadLevel("YourLevelName") with fading or extend functionality with your own Actions and Coroutines

Fluent Interface

You can use chain calls, like: Fader.Instance.FadeIn().Pause(10).FadeOut()

And More...

This asset was build in the times of Unity 3.5, grew with Unity 4 and now compatible with Unity 5

Users' Feedback

Ytrew:

This is the way assets should be, works out of the box, and like a charm! The asset provides a wide range of options to tailor the fade to really fit nicely within your project. I was looking for a fading solution, was going to write on myself then I found this. You can’t beat the price and functionality…Thanks for the great work.

Actraiser3:

While looking for a library to handle the fading of the new Unity UI Elements (think Healthbars next to enemies) I stumbled across Screen Fader. However, Version 1.5.1 did not support fading UI Elements at that time. I reached out to the author Paul Patico and he in fact added the feature within a day and submitted the updated 1.6 version to the Asset Store.
Fading UI Elements now works just fine and I really appreciate Pauls swift response and support.

Devandart:

This asset is awesome.
You get nice scene transitions in 5 minutes.
Maybe you could add some more transitions like "circular fading" in the future.

Thank you for this simple but powerful package.

API Documentation

Easiness of usage

Makes any fading with one line of code

FadeIn( time )

Fade-in screen in 'time' seconds. 'time' argument is optional, default value - 1. Fader.Instance.FadeIn();
Fader.Instance.FadeIn( 3 );
/// Fade-in in 3 sec.

FadeOut( time )

Fade screen out in 'time' seconds. 'time' argument is optional, default value - 1. Fader.Instance.FadeOut();
Fader.Instance.FadeOut( 3 );
/// Fade-in in 3 sec.

FadeIn( GameObject, time )

also FadeIn( UI.Element, time )
also FadeIn( UI.Image, time )
Fade-in gameobject. GameObject's material should support transparency. 'time' argument is optional, default value - 1.

/// Hide characterGO in 3 seconds
Fader.Instance.FadeIn( characterGO, 3 );
/// Change character’ hemlet
Fader.Instance .FadeIn( HemletOfWarion ) .FadeOut( HemletOfKing );

FadeOut( GameObject, time )

also FadeOut( UI.Element, time )
also FadeOut( UI.Image, time )
Fade gameobject out. GameObject's material should support transparency. 'time' argument is optional, default value - 1.

/// Hide wall and show Enemy Boss character.
Fader.Instance .FadeOut(Wall) .FadeIn(EnemyBoss);

Pause( time )

Make pause in chain of fadings or actions.
/// pause 1 second:
Fader.Instance.FadeIn().Pause().FadeOut();
/// pause 3 second:
Fader.Instance.FadeIn().Pause( 3 ).FadeOut();

Flash( inTime, outTime )

Make flash - quick fade-in and fade-out. Arguments inTime and outTime are optional. Default values are inTime = 0.075, outTime = 0.15
Fader.Instance.Flash();
/// Quickly fade screen in and slowly out:
Fader.Instance.Flash( 0.1, 3 );

LoadLevel( name )

Load new scene by its name:
Fader.Instance .FadeIn() .LoadLevel("Scene1").FadeOut();

Or by its index:
Fader.Instance .FadeIn() .LoadLevel(1).FadeOut();

SetColor( color )

Default color of fading is black, but this method allow changing of color at runtime.
/// Set white color and load level:
Fader.Instance .SetColor(Color.white) .FadeIn() .LoadLevel(0) .FadeOut();
/// Set red color and make a flash (damage):
Fader.Instance .SetColor(Color.red) .Flash();

StartAction( IAction )

Execute a custom action. Custom action is an instance of class implementing IAction interface.
Here is an example:

  HidePrincessAction action = new HidePrincessAction();
  Fader.Instance.StartAction(action);
  /// Hide princess while screen is faded, and then fade screen out.
  Fader.Instance.FadeIn().StartAction(action).FadeOut();

IAction interface, defines Execute() method that will be called and Completed property, that you should set to 'true' when action will completed:

  public interface IAction
  {
      bool Completed { get; set; }
      void Execute();
  }
   
  public interface HidePrincessAction: IAction
  {
      public bool Completed { get; set; }
      public void Execute()
      {
          GameObject.Find("MarioPrincess").GetComponent().enabled = false;
          /// It lets screen fader know that action is completed
          /// and next action could started.
          this.Completed = true;
      }
  }

StartAction( IParametrizedAction, object[] )

Execute a custom action that accept some parameters. Here, custom action is an instance of class implementing IParametrizedAction interface.
Let's improve our example: ChangeCharacterAction param_action = new ChangeCharacterAction();

                          /// Hide Mario and show Princess
  Fader.Instance.StartAction( param_action, "Mario", "Princess" );
  /// Hide Princess and show Mario
  Fader.Instance.StartAction( param_action, "Princess", "Mario" );
  

IParametrizedAction's Execute() method can get any number of parameters. See the implementation of ChangeCharacterAction:

    public interface ChangeCharacterAction: IParametrizedAction
    {
        public bool Completed { get; set; }
        public void Execute( params object[] args )
        {
            GameObject.Find( args[0] ).GetComponent().enabled = false;
            GameObject.Find( args[1] ).GetComponent().enabled = true;
           
            /// It lets screen fader know that action is completed
            /// and next action can be started.
            this.Completed = true;
        }
    }

StartCoroutine( MonoBehaviour, Coroutine )

Start coroutine method in series. Next fading tasks will be starter after coroutine finish. MonoBehaviour is an game object where coroutine ( IEnumerator method ) located.
NOTE: This Conoutine's methods have to have 'yield break' operator!

      /// Show 'Game Over' for 5 sec and fade-in screen.
      Fader.Instance.StartCoroutine( this, ShowGameOver() ).Pause( 5 ).FadeIn();
      ...
      IEnumerator ShowGameOver()
      {
          text.text = "Game Over";
          yield return new WaitForSeconds( 5 );
      }

StartCoroutine( MonoBehaviour, methodName, methodParameter )

Start coroutine method in parallel and pass parameter to it. Next fading tasks will be starter right after coroutine was started.

    /// Show 'You Game is Over, Mario' text for 5 sec and fade-in screen.
    Fader.Instance.StartCoroutine( this, "ShowGameOver", "Mario" ).Pause( 5 ).FadeIn();
    ...
    IEnumerator ShowText( string name )
    {
        text.text = "You Game is Over, " + name;
        yield return new WaitForSeconds( 5 );
    }

StopAllFadings()

Brakes all fadings immediately.

  Fader.Instance.StopAllFadings();