O'Reilly logo

Learning C# by Developing Games with Unity 3D Beginner's Guide by Terry Norton

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

Time for action – implementing an interface

We're going to create a C# interface and implement it in BeginState, but incorrectly to see some errors. Then we'll implement the interface correctly. Perform the following steps:

  1. In the MonoDevelop Solution window, right-click on the Code folder and select Add | New Folder.
  2. Name the folder Interfaces.
  3. Right-click on the Interfaces folder and select Add | New File.
  4. In the New File window, select General | Empty Interface.
  5. In the Name field at the bottom, enter IStateBase.
  6. Click on the New button to create the file.

In the MonoDevelop Solution window, your file structure will now look like the following screenshot:

Now edit IStateBase file as follows:

  1. Remove lines 1 and 2. As a result, namespace will move up to ...

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