CameraPathBezierAnimator.cs

CameraPathBezierAnimator.cs

public enum modes

once
loop
reverse
reverseLoop
pingPong
public CameraPathBezier bezier;
A reference to the Bezier spline class

public bool playOnStart;
Should the path to automatically animate at the start of your scene
Defaults to true

public Transform animationTarget;
The actual transform you want to animate

public bool isCamera;
Is the transform you are animating a camera?
This only affects the type of Update used at runtime.
Cameras are animated with LateUpdate as is best practice.
Non camera animations us Update.
Defaults to true.

public modes mode;
The current animation mode

public bool normalised;
Should the animation path be normalised
Defaults to true

public bool loop;
Should the animation loop to the beginning when it completes.
Defaults to false.

public float editorTime;
The time used in the editor to preview the path animation
public float pathTime;
The time the path animation should last for in seconds
Defaults to 10.

private float _percentage;
The percentage time of the animation used at runtime.

public float sensitivity;
The sensitivity of the mouse in mouselook

public float minX;
The minimum the mouse can move down

public float maxX;
The maximum the mouse can move up

public CameraPathBezierAnimator nextAnimation;
The next animation to start when this one completes

public void Play()
Play the animation as runtime

public void Stop()
Stop and set the animation at the beginning

public void Pause()
Pause the animation where it is

public void Seek(float value)
Set the time of the animtion (0-1)

public bool isPlaying
Returns a boolean on whether the animation is playing

public float percentage
A float representing the current percentage of the animation (0-1)

public bool pingPongGoingForward
A boolean representing the direction of the ping pong animation (true=forward)

public float RecalculatePercentage(float percentage)
Normalises the percentage for the curve to ensure we’re moving at a constant speed

Comments are closed.