Adventure Creator
1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
|
Public Member Functions | |
void | UpdateSimilarFollowers () |
Vector3 | GetAreaPosition (int i) |
Gets the boundary position of a particular SortingArea. More... | |
float | GetScale (Vector3 followPosition) |
Gets an interpolated scale factor, based on a position in the scene. More... | |
void | SetInBetweenScales () |
Public Attributes | |
bool | affectSorting = true |
SortingMapType | mapType = SortingMapType.OrderInLayer |
List< SortingArea > | sortingAreas = new List<SortingArea>() |
bool | affectScale = false |
bool | affectSpeed = true |
int | originScale = 100 |
SortingMapScaleType | sortingMapScaleType = SortingMapScaleType.Linear |
AnimationCurve | scalingAnimationCurve |
Protected Member Functions | |
void | OnEnable () |
void | Start () |
void | OnDisable () |
void | OnDrawGizmos () |
Static Protected Member Functions | |
static int | SortByScreenPosition (FollowSortingMap o1, FollowSortingMap o2) |
Protected Attributes | |
Transform | _transform |
Properties | |
Transform | Transform [get] |
This script is used to change the sorting order and scale of 2D characters, based on their position in the scene. The instance of this class stored in SceneSettings' sortingMap variable will be read by FollowSortingMap components to determine what their SpriteRenderer's order and scale should be.
Vector3 AC.SortingMap.GetAreaPosition | ( | int | i | ) |
Gets the boundary position of a particular SortingArea.
i | The index of the SortingArea to get the boundary position of |
float AC.SortingMap.GetScale | ( | Vector3 | followPosition | ) |
Gets an interpolated scale factor, based on a position in the scene.
followPosition | The position in the scene to get the scale factor for |
void AC.SortingMap.SetInBetweenScales | ( | ) |
Assigns the scale factors for all SortingArea data that lie in between the top and bottom boundaries.
void AC.SortingMap.UpdateSimilarFollowers | ( | ) |
Adjusts all relevant FollowSortingMaps that are within the same region, so that they are all displayed correctly.
bool AC.SortingMap.affectScale = false |
True if characters that follow this map should have their scale affected
bool AC.SortingMap.affectSorting = true |
True if characters that follow this map should have their sorting affected
bool AC.SortingMap.affectSpeed = true |
True if characters that follow this map should have their movement speed affected by the scale factor
SortingMapType AC.SortingMap.mapType = SortingMapType.OrderInLayer |
How SpriteRenderer components that follow this map are effected (OrderInLayer, SortingLayer)
int AC.SortingMap.originScale = 100 |
The scale (as a percentage) that characters will have at the very top of the map (if affectScale = True)
AnimationCurve AC.SortingMap.scalingAnimationCurve |
The AnimationCurve used to define character scaling, where 0s is the smallest scale, and 1s is the largest (if sortingMapScaleType = AnimationCurve)
List<SortingArea> AC.SortingMap.sortingAreas = new List<SortingArea>() |
A List of SortingArea data that makes up the map
SortingMapScaleType AC.SortingMap.sortingMapScaleType = SortingMapScaleType.Linear |
How scaling values are defined (Linear, AnimationCurve)
|
get |
A cache of the SortingMap's transform component