Custom Camera Mode
CameraMode
class MyCameraMode implements CameraMode {
// OnStart is called by the camera system when the mode begins.
OnStart(camera: Camera): void {}
// OnStop is called when the camera system stops this mode.
OnStop(): void {}
// OnUpdate is called during Unity's Update stage.
// This method is useful for handling user input, and sets itself
// at LOWEST priority on the connection, to attempt to run after
// any other Update code has run in the game.
OnUpdate(deltaTime: number): void {}
// OnLateUpdate is called during Unity's LateUpdate stage.
// This method must return a CameraTransform, representing the
// camera's position and rotation. This method sets itself at
// the HIGHEST priority on the connection, attempting to run
// first in the LateUpdate stage before anything else.
OnLateUpdate(deltaTime: number): CameraTransform {}
// This method is called right after the Unity camera's transform has
// been set with the data from OnLateUpdate. This might be useful if
// other custom transforms need to be added onto the camera outside of
// just returning a position and rotation in OnLateUpdate.
OnPostUpdate(camera: Camera): void {}
}Running a CameraMode
Stopping a CameraMode
Default Mode
Field Of View
Input Control Responsibility
Performance Responsibility
Last updated