Hi,
Im using this script below, what it does is when my game starts there is a 2d texture covering the game area and a PlayNow Button. I want the game to be paused as soon as it starts then when the player hits the playnow button the game will be playable and it is un-paused.
var displaySplashBackground : boolean = true;
var splashBackground : Texture2D;
var PopupSkin : GUISkin;
function OnGUI()
{
GUI.skin = PopupSkin;
if(displaySplashBackground)
{
GUI.Label (Rect (0,0, 600,450), splashBackground, GUIStyle.none);
Time.timeScale = 0; //pause game
if (GUI.Button (Rect (180, 10, 222,76), "","PlayNow"))
{
displaySplashBackground = false;
Screen.showCursor = false;//hide the cursor on play
Time.timeScale = 1; //now un-pause the game
}
}
}
This works fine inside of Unity but when I create a web player build it does not seem to be working? So Im not sure if Im doing something wrong? or is there another way to pause the game?
Edit ok it seems to be pausing the player just not the enemies So at least the player will not run off of the edges which is good and I’ll try not to do any pausing unless all enemies are dead.