Closing Credits

Overview

Closing credits generates a nice-looking credit roll.

Files

Usage

After importing the package, the first thing you will want to do is to create a Credits file. Simply go to the Window menu and select Credits Editor.

When you first open the editor window, only two buttons are available on the top left of the window: a button for creating a new file and one for opening an existing file, they are pretty straightforward. Click on the first button and create somewhere in your project the credits file.

The green + button at the top will add a new row at the bottom of the credits. In the main part of the window are the credits rows. For each row you can:

When your credits file is complete and saved, you must drag and drop the 2_Prefabs/Credits prefab in your root GUI gameobject. Some people directly used the demo scene for their game.

Properties

Credits File
The credits file you have created using the Credits Editor.
Play On Awake
Closing credits will start as soon as the scene is loaded when set to TRUE.
Speed
Speed of the credits. 50 is a good value.
Fade Time
In how many time the credits will fade in and out. In seconds.
Prefab ...
Fill those by drag and dropping the corresponding prefabs from the 2_Prefabs/ folder.
Now your credits are ready! Play the scene and watch the result!

Modifying the credits

This new version of Credit Roll uses the new GUI system of Unity 4.6/5. You can change the color, the size, the font and all the properties for each type of line by altering the prefabs in the 2_Prefabs/ folder.

The height determines the line spacing, as the text is vertically align to the top. This allows you to set a different line spacing for each type of line.

Don’t forget that you can add scripts like Shadow or Outline for your texts, which are shipped by default with Unity.

Scripting and callbacks

If you did not set Play On Awake to TRUE, you can start the closing credits with the beginCredits() function. The Credits class is set as a singleton for convenience:

Credits.getInstance().beginCredits();

If you want to know when the credits ends, create a script and use the C# event system like this:

public class CreditsExampleScript : MonoBehaviour
{
  void Start()
  {
    // Callback
    Credits.getInstance().endListeners += new Credits.CreditsEndListener(creditsEnded); // creditsEnded is the name of the function
  }

  void creditsEnded(Credits c)
  {
    // Do something, like changing scene
  }
}

You can find those examples in the 3_Demo/CreditsExampleScript.cs file.

You now know everything about this addon!