- Home /
Question by
MewEight · Oct 22, 2014 at 03:34 AM ·
c#application.loadlevel
[C#] How to avoid running any more codes after Application.LoadLevel?
if(_tileMap.storedMapData.GetSquadAtTile(gridCoord.x, gridCoord.y))
{
GameObject tempObj = _tileMap.storedMapData.GetSquadAtTile(gridCoord.x, gridCoord.y);
if(tempObj.GetComponent<PlayerSquad>())
{
// Skip adding the player here.
return;
}
else
{
// Do FIGHT !!!
Application.LoadLevel("battleScene");
Debug.Log("Fight Night !" );
}
}
How to switch the scene without print out "Fight Night"
Comment
Answer by Itaros · Oct 22, 2014 at 06:57 AM
Put "return;" after "Application.LoadLevel("battleScene");"