Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.CameraZone Class Reference

An area which the camera can be moved to and within. More...

Inheritance diagram for PlatformerPro.CameraZone:
PlatformerPro.PlatformerProMonoBehaviour PlatformerPro.CameraTransitionPoint

Public Member Functions

bool IsInZone (Transform t)
 Returns true if transform is in zone. More...
 
virtual Vector2 Max (Camera camera)
 Gets the maximum bounds. More...
 
virtual Vector2 Min (Camera camera)
 Gets the minimum bounds. More...
 
Vector3 GetBestPositionForCharacter (Camera camera, Character character)
 
- Public Member Functions inherited from PlatformerPro.PlatformerProMonoBehaviour
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 cameraZOffset
 The cameras Z offset from this zones transform. More...
 
float width
 Width of the zone in world units. More...
 
float height
 Height of the zone in world units. More...
 
bool updateDynamically
 
Color zoneColor = new Color(0,0,1,0.05f)
 
Color outlineColor = new Color(0,0,1,0.25f)
 

Static Public Attributes

static List< CameraZonecameraZones = new List<CameraZone>()
 Static list of all camera zones. More...
 

Protected Member Functions

virtual void Init ()
 Checks bounds make sense (i.e. are not too small to fit main camera) and then stores them. More...
 

Protected Attributes

Vector2 min
 
Vector2 max
 
bool initialised
 

Properties

bool ZoneSmallerThanView [get, protected set]
 Track if the zone is smaller than camera viewport. If it is we wont snap to bounds. More...
 
virtual Vector3 CameraPosition [get]
 Gets the position the camera should transition to. More...
 
virtual CameraZone ActualZone [get]
 Gets the actual zone that the camera should be in. Could be different to this for example in the case of a Transition Point. More...
 
- Properties inherited from PlatformerPro.PlatformerProMonoBehaviour
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...
 

Detailed Description

An area which the camera can be moved to and within.

Member Function Documentation

◆ GetBestPositionForCharacter()

Vector3 PlatformerPro.CameraZone.GetBestPositionForCharacter ( Camera  camera,
Character  character 
)

◆ Init()

virtual void PlatformerPro.CameraZone.Init ( )
protectedvirtual

Checks bounds make sense (i.e. are not too small to fit main camera) and then stores them.

Reimplemented in PlatformerPro.CameraTransitionPoint.

◆ IsInZone()

bool PlatformerPro.CameraZone.IsInZone ( Transform  t)

Returns true if transform is in zone.

Returns
true if this instance is in zone the specified t; otherwise, false.
Parameters
tTransform.

◆ Max()

virtual Vector2 PlatformerPro.CameraZone.Max ( Camera  camera)
virtual

Gets the maximum bounds.

◆ Min()

virtual Vector2 PlatformerPro.CameraZone.Min ( Camera  camera)
virtual

Gets the minimum bounds.

Member Data Documentation

◆ cameraZOffset

float PlatformerPro.CameraZone.cameraZOffset

The cameras Z offset from this zones transform.

◆ cameraZones

List<CameraZone> PlatformerPro.CameraZone.cameraZones = new List<CameraZone>()
static

Static list of all camera zones.

◆ height

float PlatformerPro.CameraZone.height

Height of the zone in world units.

◆ initialised

bool PlatformerPro.CameraZone.initialised
protected

◆ max

Vector2 PlatformerPro.CameraZone.max
protected

◆ min

Vector2 PlatformerPro.CameraZone.min
protected

◆ outlineColor

Color PlatformerPro.CameraZone.outlineColor = new Color(0,0,1,0.25f)

◆ updateDynamically

bool PlatformerPro.CameraZone.updateDynamically

◆ width

float PlatformerPro.CameraZone.width

Width of the zone in world units.

◆ zoneColor

Color PlatformerPro.CameraZone.zoneColor = new Color(0,0,1,0.05f)

Property Documentation

◆ ActualZone

virtual CameraZone PlatformerPro.CameraZone.ActualZone
get

Gets the actual zone that the camera should be in. Could be different to this for example in the case of a Transition Point.

The actual zone.

◆ CameraPosition

virtual Vector3 PlatformerPro.CameraZone.CameraPosition
get

Gets the position the camera should transition to.

◆ ZoneSmallerThanView

bool PlatformerPro.CameraZone.ZoneSmallerThanView
getprotected set

Track if the zone is smaller than camera viewport. If it is we wont snap to bounds.


The documentation for this class was generated from the following file: