Adventure Creator
1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
|
Public Types | |
enum | HorizontalParallaxConstraint { Left, Right } |
enum | VerticalParallaxConstraint { Top, Bottom } |
Public Member Functions | |
void | UpdateOffset () |
Public Attributes | |
float | depth |
bool | xScroll |
bool | yScroll |
float | xOffset |
float | yOffset |
bool | limitX |
float | minX |
float | maxX |
bool | limitY |
float | minY |
float | maxY |
ParallaxReactsTo | reactsTo = ParallaxReactsTo.Camera |
Transform | transformToReactTo |
HorizontalParallaxConstraint | horizontalConstraint |
VerticalParallaxConstraint | verticalConstraint |
SpriteRenderer | backgroundConstraint = null |
Protected Member Functions | |
void | Awake () |
void | OnEnable () |
void | Start () |
void | OnDisable () |
virtual void | Initialise () |
Protected Attributes | |
float | xStart |
float | yStart |
float | xDesired |
float | yDesired |
Vector2 | perspectiveOffset |
When used in 2D games, this script can be attached to scene objects to make them scroll as the camera moves, creating a parallax effect.
void AC.Parallax2D.UpdateOffset | ( | ) |
Updates the GameObject's position according to the camera. This is called every frame by the StateHandler.
float AC.Parallax2D.depth |
The intensity of the depth effect. Positive values will make the GameObject appear further away (i.e. in the background), negative values will make it appear closer to the camera (i.e. in the foreground).
bool AC.Parallax2D.limitX |
If True, scrolling in the X-direction will be constrained
bool AC.Parallax2D.limitY |
If True, scrolling in the Y-direction will be constrained
float AC.Parallax2D.maxX |
The maximum scrolling position in the X-direction, if limitX = True
float AC.Parallax2D.maxY |
The maximum scrolling position in the Y-direction, if limitY = True
float AC.Parallax2D.minX |
The minimum scrolling position in the X-direction, if limitX = True
float AC.Parallax2D.minY |
The minimum scrolling position in the Y-direction, if limitY = True
ParallaxReactsTo AC.Parallax2D.reactsTo = ParallaxReactsTo.Camera |
What entity affects the parallax behaviour (Camera, Cursor, Transform)
Transform AC.Parallax2D.transformToReactTo |
Which GameObject affects behaviour, if reactsTo = ParallaxReactsTo.Transform
float AC.Parallax2D.xOffset |
An offset for the GameObject's initial position along the X-axis
bool AC.Parallax2D.xScroll |
If True, then the GameObject will scroll in the X-direction
float AC.Parallax2D.yOffset |
An offset for the GameObject's initial position along the Y-axis
bool AC.Parallax2D.yScroll |
If True, then the GameObject will scroll in the Y-direction