O'Reilly logo

Building an RPG with Unity 5.x by Vahé Karamian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Changes to UI Controller

The UI Controller will also need to be updated now to make the necessary changes to the GameMaster object. We would need to update the LoadLevel() function to the following:

public void LoadLevel()
{
if(GameObject.FindGameObjectWithTag("BASE"))
{
GameMaster.instance.PC_CC = GameObject.FindGameObjectWithTag("BASE").GetComponent<CharacterCustomization>().PC_CC;
}
GameMaster.instance.LEVEL_CONTROLLER.LEVEL = 1;
GameMaster.instance.LoadLevel();
}

This will make sure that GameMaster is updated with the proper player character data. Let's go ahead and test the code.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required