Time for action – creating a script and a class

We are going to create the StateManager script and the BeginState class, then add some code so that we can instantiate BeginState to make an instance of BeginState. With the help of the next screenshot, perform the following steps:

  1. In the Unity Project window, create a C# Script in the Scripts folder.
  2. Name the script StateManager.
  3. Double-click on StateManager to open it in MonoDevelop.
  4. In the MonoDevelop Solution window, right-click on the Code folder and select Add | New Folder.
  5. Name the folder States.
  6. Right-click on the States folder and select Add | New File.
  7. In the New File window, select General | Empty Class.
  8. In the Name field at the bottom, enter BeginState.
  9. Click on the New button to create the

Get Learning C# by Developing Games with Unity 3D Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.