![]() |
Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
|
Public Member Functions | |
| void | SetDepth (int depth) |
| Sets the depth of the GameObject compared with other GameObjects in the same Sorting Map region, by shifting the position along the "depth" axis by a small amount. | |
| void | UpdateSortingMap () |
| SortingMap | GetSortingMap () |
| Gets the SortingMap that this component follows. | |
| void | SetSortingMap (SortingMap _sortingMap) |
| Sets the SortingMap that this component follows. | |
| void | LockSortingOrder (int order) |
| Locks the SpriteRenderer to a specific order within its layer. | |
| void | LockSortingLayer (string layer) |
| Locks the SpriteRenderer to a specific layer. | |
| float | GetLocalScale () |
| Gets the intended scale factor of the GameObject, based on its position on the scene's SortingMap. | |
| float | GetLocalSpeed () |
| Gets the indended speed factor of the GameObject, based on its position on the scene's SortingMap. | |
Public Attributes | |
| bool | lockSorting = false |
| bool | affectChildren = true |
| bool | followSortingMap = true |
| SortingMap | customSortingMap = null |
| bool | offsetOriginal = false |
| bool | livePreview = false |
Protected Types | |
| enum | DepthAxis { Y , Z } |
Protected Attributes | |
| Vector3 | originalPosition |
| DepthAxis | depthAxis = DepthAxis.Y |
| Renderer[] | renderers |
| Renderer | _renderer |
| SortingGroup | sortingGroup |
| List< int > | offsets = new List<int>() |
| int | sortingOrder = 0 |
| string | sortingLayer = "" |
| SortingMap | sortingMap |
| int | sharedDepth = 0 |
| bool | depthSet = false |
Properties | |
| int | SortingOrder [get] |
| string | SortingLayer [get] |
| int | SharedDepth [get] |
| Transform | Transform [get] |
Attach this script to a GameObject to affect the sorting values of its SpriteRenderer component, according to the scene's SortingMap. It is also used by the Char script to scale a 2D character's sprite child, if the SortingMap controls scale. This is intended for 2D character sprites, to handle their scale and display when moving around a scene.
| float AC.FollowSortingMap.GetLocalScale | ( | ) |
Gets the intended scale factor of the GameObject, based on its position on the scene's SortingMap.
| float AC.FollowSortingMap.GetLocalSpeed | ( | ) |
Gets the indended speed factor of the GameObject, based on its position on the scene's SortingMap.
| SortingMap AC.FollowSortingMap.GetSortingMap | ( | ) |
Gets the SortingMap that this component follows.
| void AC.FollowSortingMap.LockSortingLayer | ( | string | layer | ) |
Locks the SpriteRenderer to a specific layer.
| layer | The layer to lock the SpriteRenderer to |
| void AC.FollowSortingMap.LockSortingOrder | ( | int | order | ) |
Locks the SpriteRenderer to a specific order within its layer.
| order | The order within its current layer to lock the SpriteRenderer to |
| void AC.FollowSortingMap.SetDepth | ( | int | depth | ) |
Sets the depth of the GameObject compared with other GameObjects in the same Sorting Map region, by shifting the position along the "depth" axis by a small amount.
| depth | The amount to offset the GameObject by. The true shift distance will be this value multipled by the SceneSettings script's sharedLayerSeparationDistance value |
| void AC.FollowSortingMap.SetSortingMap | ( | SortingMap | _sortingMap | ) |
Sets the SortingMap that this component follows.
| _sortingMap | The SortingMap to follow. If this is null, then it will revert to the scene's default. |
| void AC.FollowSortingMap.UpdateSortingMap | ( | ) |
Tells the scene's SortingMap to account for this particular instance of FollowSortingMap.
| bool AC.FollowSortingMap.affectChildren = true |
If True, then the sorting values of child SpriteRenderers will be affected as well
| SortingMap AC.FollowSortingMap.customSortingMap = null |
The SortingMap to follow, if not the scene default (and followSortingMap = False)
| bool AC.FollowSortingMap.followSortingMap = true |
If True, then the component will follow the default SortingMap, as defined in SceneSettings
| bool AC.FollowSortingMap.livePreview = false |
If True, then the script will update the SpriteRender's sorting values when the game is not running
| bool AC.FollowSortingMap.lockSorting = false |
If True, the SpriteRenderer's sorting values will be locked to their current values
| bool AC.FollowSortingMap.offsetOriginal = false |
If True, then the SpriteRenderer's sorting values will be increased by their original values when the game began
|
get |
The relative depth compared with other GameObjects in the same Sorting Map region.
|
get |
The layer of the sprite, according to the GameObject's position in the SortingMap, provided that the mapType = SortingMapType.SortingLayer
|
get |
The order of the sprite, according to the GameObject's position in the SortingMap, provided that the mapType = SortingMapType.OrderInLayer
|
get |
A cache of the FollowSortingMap's transform component