Using the Public API
The OrbitalCameraSystem has many public properties which can be set from other scripts/components in your project. These would primarily be used to allow the polayer to change the settings of the camera system, based on their preferences. You would need to implement your own preferences menu if you wish the player to be able to fx. invert camera movement, or toggle edge-scrolling on/off.
The scripts also has a bunch of Public Methods that can be called from other scripts. These will primarily be used to animate the camera to a new position. This animation of the camera might be a result of a cutscene starting, or a special event in your game (like a fire or a wedding). It could also be a result of the user clicking on a minimap og pressing a 'Go to home' button.
In this section I'll give some examples of how to use the public methods.
Communicating with the OrbitalCameraSystem
To be able to invoke methods on the OrbitalCameraSystem, you'll need a reference to this script in your other script. The easiest way to achieve this is to create a Serializable private field, and just drag your scenes OrbitalCam into that slot. If this is not possible, consider using dependecy injection or use GetComponentInParent on Camera.main to get the OrbitalCameraSystem component.
Note
If using the GetComponentInParent approach, it would be advisable to cache a reference to the component in a variable during Awake or Start.
Public Properties
The Public Properties are visible in the documentation. Their names correspond to the fields in the Controls Explanation.
Movement, Rotation & Zoom
The following methods can be used to instantly set the camera to a new position, rotation or zoom distance:
Instant change
Animated change
The following methods can be used to animate the camera to a new position, rotation or zoom distance:
Note
The second argument is the animation time in seconds. This is optional, and will otherwise use the default animation time set in the Speeds controls section.
Multiple animations of different types can be executed simultaneously (fx. a movement and a zoom animation). If custom timing is provided, they will all use the timing provided last. All animations will thus end at the same time.
Multiple animations of the same type cannot be executed simultaneously - and only the last one executed will be effectuated. To string together multiple animations with a delay in between, you would need to use a Coroutine or similar asynchronous approach.
Animation Timing
The default animation time is set in the Speeds section of the OrbitalCameraSystem.
The animation time can also be controlled on each of the animation methods. It's always the second argument, given as a float and it's always optional. If none is given, the default is used.