PlayerSpawn.OnGUI C# (CSharp) Method

OnGUI() public method

public OnGUI ( ) : void
return void
    void OnGUI()
    {
        //show on the left top how many lives left
        if (lives > 0 || playerObject != null)
        {
            GUI.Label(new Rect(10, 60, 40, 50), "  lives:" + lives);
        }

        //if there is no lives leave and player is die show gameover
        else
        {
            GUI.Label(new Rect(Screen.width/2,Screen.height/2-25, 100, 50), " Game Over ");
        }
    }