////////////////////////////////////////////////////////////////////////////////////////
// Purpose: To fade out a white texture when transitioning into the game
//
//
////////////////////////////////////////////////////////////////////////////////////////
#pragma strict
// Texture to fade out of view
public var theTexture : Texture2D;
//
// Create a private float variable that will store the starting time of when the level has loaded
function OnLevelWasLoaded(level : int)
{
// Set your starting time variable you created above to the current time of the game when it was loaded
// You can access the current game time with the following call:
// Time.time
}
function Update () {
// Fading out the white texture so that you get a transition of when you start the level
// Check to see if the current game time subtracted by the start time is greater than or
// equal to 3, refer to the BatteryCollect class in this assignment for good examples of if checks
// If so, then Destroy the local gameObject
// This is done by calling Destroy(gameObject)
}
function OnGUI()
{
// Use the private floating variable above and subtract it from the Time.time variable in the
// Lerp function here
// Uncomment the code below, making sure you include your variable being subtracted below in order for this
// section to work correctly
//GUI.color = Color.white;
//GUI.color.a = Mathf.Lerp(1.0, 0.0, (Time.time /* - your variable */));
//GUI.DrawTexture(Rect(0, 0, Screen.width, Screen.height), theTexture);
}