Summary

We looked into using Unity's Reference Manual and the Scripting Reference. As a beginner, probably the most time consuming part of writing code will be searching Unity's documentation for the information you need. We expanded the State Machine and added a Player GameObject. Planning ahead before writing code is always a good idea. A State Machine is a good option for organizing your project's code. Nine State classes were created for the State machine. We then displayed a splash screen and a button in BeginState. For the SetupState, we displayed a spinning Player and some GUI buttons to set Player options.

A major point to be taken from writing all this code is that public variables and methods in any class or script are easily accessed. All that's needed is a reference to an object, then you can use Dot Syntax to easily access data and methods.

In the next chapter, we will continue the game development by entering our first PlayState and see how the State Machine provides game control flexibility and code organization.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.108.175