2D Code Snippets

The code snippets below are intended to be used in Unity’s 2D development environment.

CameraScript.cs

Fading.cs

Import the file: black.jpg into your sprites folder and adjust the settings to match the image below, then add the script below to a GameObject in your scene (LevelManager for example). Drag black.jpg into “Fade Out Text.”
black

black-settings

LevelAdvance.cs

Create an empty GameObject called LevelManager and add this script to advance between levels.