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 ...

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.