![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
A camera which smoothly centers on the character and also allows movement between zones. More...
Public Member Functions | |
override void | Init () |
Initialise this instance. More... | |
override void | ChangeZone (CameraZone newZone, Character triggeringCharacter=null) |
Changes the zone by smoothly animating to the new zone. More... | |
virtual void | ZoneHasBeenChanged (Transform t, Vector3 p) |
Called when the zones the been changed. More... | |
![]() | |
virtual void | Validate (PlatformerProMonoBehaviour myTarget) |
Override this method if you want to provide custom validation. The actual code should be surrounded by the if UNITY_EDITOR / endif directive. More... | |
Public Attributes | |
float | transitionSpeed |
How fast to move to the new camera zone. More... | |
TweenMode | tweenMode |
How to move to the new camera zone. More... | |
bool | freezePlayerDuringTransition |
If true the character will be completely frozen during the transition. More... | |
CameraAxisSettings | xAxis |
Follow settings for xAxis; More... | |
CameraAxisSettings | yAxis |
Follow settings for yAxis; More... | |
bool | snapOnRespawn |
If the character is teleported or respawned should be snap to that position or animate to it? More... | |
bool | allowZoom |
Can this camera zoom in and out. More... | |
float | maximumZoom = 10.0f |
Maximum zoom level. More... | |
CameraZoomMode | zoomMode |
How should we implement the zoom? More... | |
Vector2 | borderSize = Vector2.one |
How big should the border around the characters be (to enure they can see in 'front' of themselves)? More... | |
![]() | |
bool | isDefaultCamera |
Set to true if this is the default camera. More... | |
CameraZone | startingZone |
The starting zone. More... | |
System.EventHandler< CameraZoneChangeEventArgs > | CameraZoneChanged |
Event sent when the camera zone changes. This event is sent when the zone change starts. Add a handler to the tweener to listen to the zone change end for a change that is not instantaneous (or delay your event response). More... | |
Protected Member Functions | |
override void | DoDestroy () |
Do the destroy actions. More... | |
virtual void | HandleCharacterLoaded (object sender, CharacterEventArgs e) |
Handles a character being loaded. More... | |
virtual void | HandleCharacterRemoved (object sender, CharacterEventArgs e) |
Handles a character being removed. More... | |
virtual void | HandleRespawned (object sender, CharacterEventArgs e) |
Handles the respawned event More... | |
void | DoMove () |
Move the camera More... | |
void | DoZoom () |
Handles the zoom of the camera. More... | |
void | MoveInX () |
Moves the camera in x. More... | |
void | MoveInY () |
Moves the camera in y. More... | |
void | LimitToBounds () |
Limits camera position to the current zones bounds. More... | |
![]() | |
virtual void | OnCameraZoneChanged (CameraZone oldZone, CameraZone newZone) |
Send the Camera Zone changed event. More... | |
Protected Attributes | |
float | defaultZoom |
The default zoom which comes form the cameras initial value. We cannot zoom in more than the default unless you use code to manually force a zoom level. More... | |
bool | movingInX |
Is camera moving in x. More... | |
bool | movingInY |
Is camera moving in y. More... | |
List< PlatformerProGameManager > | characterLoaders |
Reference to the character loaders. More... | |
float | distanceMovedLastFrameX |
How far did we move last frame in X More... | |
float | distanceMovedLastFrameY |
How far did we move last frame in X More... | |
float | actualSmoothingFactorX |
The actual smoothing factor in X. More... | |
float | actualSmoothingFactorY |
The actual smoothing factor in Y. More... | |
bool | isInTransition |
True while the camera is moving. More... | |
PositionTweener | tweener |
Tweener which handles any moves. More... | |
CameraZone | targetZone |
Zone we are moving to. More... | |
Vector3 | targetPosition |
Where are we moving to? More... | |
List< Character > | characters |
Reference to the character being followed. More... | |
![]() | |
CameraZone | currentZone |
The current zone. More... | |
Camera | myCamera |
Cached reference to the associated Unity camera. More... | |
Static Protected Attributes | |
const float | SmoothingFactor = 1.125f |
Never allow frames to move more than this factor relative to previous frame. More... | |
const float | MAX_SPEED_FOR_STILL = 0.4f |
If camera movement is smaller than this it is considered still. More... | |
![]() | |
static List< PlatformCamera > | allCameras |
A list of all camera. More... | |
static PlatformCamera | defaultCamera |
The main or default camera. More... | |
Properties | |
override string | Header [get] |
Gets the header string used to describe the component. More... | |
virtual Vector2 | AverageTransformPosition [get] |
![]() | |
CameraZone | CurrentZone [get, set] |
Gets the current zone. More... | |
static PlatformCamera | DefaultCamera [get] |
Gets the default camera. More... | |
static PlatformCamera[] | AllCameras [get] |
Gets the default camera. More... | |
![]() | |
virtual string | Header [get] |
Gets the header string used to describe the component. More... | |
virtual string | DocLink [get] |
Gets a link to documentation site. More... | |
virtual string | VideoLink [get] |
Gets a link to a youtube video. More... | |
virtual string | Deprecated [get] |
If non-null this component is deprecated. The string shows a message indicating how it should be replaced. More... | |
Additional Inherited Members | |
![]() | |
static void | AddCamera (PlatformCamera platformCamera) |
Adds a camera to the global list. More... | |
static void | RemoveCamera (PlatformCamera platformCamera) |
Removes a camera from the global list. More... | |
static void | SetDefaultCamera () |
Sets the main camera. More... | |
A camera which smoothly centers on the character and also allows movement between zones.
|
virtual |
Changes the zone by smoothly animating to the new zone.
newZone | The zone to move to. |
triggeringCharacter | Character that triggered the transition./param> |
Reimplemented from PlatformerPro.PlatformCamera.
|
protectedvirtual |
Do the destroy actions.
Reimplemented from PlatformerPro.PlatformCamera.
|
protected |
Move the camera
|
protected |
Handles the zoom of the camera.
|
protectedvirtual |
Handles a character being loaded.
sender | Sender. |
e | Event args. |
|
protectedvirtual |
Handles a character being removed.
sender | Sender. |
e | Event args. |
|
protectedvirtual |
Handles the respawned event
sender | Sender. |
e | Even details. |
|
virtual |
Initialise this instance.
Reimplemented from PlatformerPro.PlatformCamera.
|
protected |
Limits camera position to the current zones bounds.
|
protected |
Moves the camera in x.
|
protected |
Moves the camera in y.
|
virtual |
Called when the zones the been changed.
|
protected |
The actual smoothing factor in X.
|
protected |
The actual smoothing factor in Y.
bool PlatformerPro.PlatformerProStandardCamera.allowZoom |
Can this camera zoom in and out.
Vector2 PlatformerPro.PlatformerProStandardCamera.borderSize = Vector2.one |
How big should the border around the characters be (to enure they can see in 'front' of themselves)?
|
protected |
Reference to the character loaders.
|
protected |
Reference to the character being followed.
|
protected |
The default zoom which comes form the cameras initial value. We cannot zoom in more than the default unless you use code to manually force a zoom level.
|
protected |
How far did we move last frame in X
|
protected |
How far did we move last frame in X
bool PlatformerPro.PlatformerProStandardCamera.freezePlayerDuringTransition |
If true the character will be completely frozen during the transition.
|
protected |
True while the camera is moving.
|
staticprotected |
If camera movement is smaller than this it is considered still.
float PlatformerPro.PlatformerProStandardCamera.maximumZoom = 10.0f |
Maximum zoom level.
|
protected |
Is camera moving in x.
|
protected |
Is camera moving in y.
|
staticprotected |
Never allow frames to move more than this factor relative to previous frame.
bool PlatformerPro.PlatformerProStandardCamera.snapOnRespawn |
If the character is teleported or respawned should be snap to that position or animate to it?
|
protected |
Where are we moving to?
|
protected |
Zone we are moving to.
float PlatformerPro.PlatformerProStandardCamera.transitionSpeed |
How fast to move to the new camera zone.
|
protected |
Tweener which handles any moves.
TweenMode PlatformerPro.PlatformerProStandardCamera.tweenMode |
How to move to the new camera zone.
CameraAxisSettings PlatformerPro.PlatformerProStandardCamera.xAxis |
Follow settings for xAxis;
CameraAxisSettings PlatformerPro.PlatformerProStandardCamera.yAxis |
Follow settings for yAxis;
CameraZoomMode PlatformerPro.PlatformerProStandardCamera.zoomMode |
How should we implement the zoom?
|
getprotected |
|
get |
Gets the header string used to describe the component.
The header.