O'Reilly logo

Practical Game Design with Unity and Playmaker by Sergey Mohov

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

Creating a Playmaker action

It is time to translate our script to C#. Create a new C# script the same way you created the JS one. Call it PushPuckAction. Open the script and find the line starting with the public class keywords. Make sure that the name of the class is the same as the name of the script, then press command + S (Ctrl + S in Windows) to save your changes if you made any.

As you can see, the default template for a C# script looks different from that of JS. This is because more things are shown to you. For instance, in JS it is implied that everything inside a script is, in fact, in a class with the same name, but you do not see the class declaration anywhere. Component classes in Unity have to inherit from MonoBehaviour, and it is ...

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