Actor

Actor is our substitute for MonoBehaviours, it optimizes and creates shortcuts for useful stuff.

Moving an object

Moving object with MonoBehaviours

transform.position = new Vector3(0, 0, 123);

Moving an object with Actor

Position = new Vector3(0, 0, 123);

The reason we do that is because transform.position goes into C++ every single time to get the transform, which can lead to performance issues later in development. Also it is a nice shortcut.

You can use the same idea for Rotation, and for getting the directions relative to that transform, like Forward, Up, Down.

Callbacks

The standard callback methods also have been changed, you'll use OnStart instead of Start, OnAwake instead of Awake, OnDestroyed instead of OnDestroy.

Another think you need to know is HandleUpdate, HandleLateUpdate and HandlePreUpdate. All these methods have one thing in common: they listen to an event bus to be called.

The reason being that in standard Unity environment, the engine searches through the entire instantiated object's list and tries to find the Update method declared somewhere. That's very slow.

Instead, our friend from the CS Framework decided to create an event bus for the player loop timing, so Unity only needs to worry about one object with the Update method.

Every method that listens to the UpdateEvent event bus and its variants will then be called.

Networking

For networked objects, instead of NetworkBehaviour, you will use NetworkActor. They work the same way as Actor.

Last updated