Railcam 2D
Store

RailUtilities

public static class Railcam2D.RailUtilities;

A static class containing the core logic of Railcam 2D. This class is used by the Railcam 2D component to calculate camera position.

Public Members


GetCameraPosition(Vector2, Rail)

public static Vector2 GetCameraPosition(Vector2 targetPosition, Rail rail);
Member Method
Returns UnityEngine.Vector2

Allows camera position to be calculated using a specific Rail.

Parameters

Name Type
targetPosition UnityEngine.Vector2
rail Railcam2D.Rail

The targetPosition parameter is the position of the camera target (or combined position of multiple targets) that the camera is following.

The rail parameter is the Rail that is used to calculate camera position.


GetCameraPosition(Vector2, Rail[])

public static Vector2 GetCameraPosition(Vector2 targetPosition, Rail[] rails);
Member Method
Returns UnityEngine.Vector2

The primary method used to calculate camera position. Used by the Railcam 2D component.

Parameters

Name Type
targetPosition UnityEngine.Vector2
rails Railcam2D.Rail[]

The targetPosition parameter is the position of the camera target (or combined position of multiple targets) that the camera is following.

The rails parameter is an array of Rails that are used to calculate camera position.

Jonathan Madelaine © 2020