Summary
Replaces the
UnityEngine.SpriteRenderer.sprite
with a copy of it that uses a different Animancer.SpriteRendererTextureSwap.Texture
during every Animancer.SpriteRendererTextureSwap.LateUpdate
.
- Assembly
- Animancer
.dll - Namespace
- Animancer
- Base Types
-
- MonoBehaviour
graph BT
Type-->Base0["MonoBehaviour"]
Type["SpriteRendererTextureSwap"]
class Type type-node
Syntax
[AddComponentMenu(Strings.MenuPrefix + "Sprite Renderer Texture Swap")]
[HelpURL(Strings.DocsURLs.APIDocumentation + "/" + nameof(SpriteRendererTextureSwap))]
[DefaultExecutionOrder(DefaultExecutionOrder)]
public class SpriteRendererTextureSwap : MonoBehaviour
Remarks
This script is not specific to Animancer and will work with any animation system if you remove the
[
UnityEngine.AddComponentMenu
] and [HelpURL
] attributes.
Attributes
Type | Description |
---|---|
AddComponentMenu | |
HelpURLAttribute | |
Default |
Fields
Name | Constant Value | Summary |
---|---|---|
Default |
30000 |
Execute very late (32000 is last).
static
|
Properties
Methods
Name | Value | Summary |
---|---|---|
Awake |
void | |
ClearCache |
void |
Destroys all sprites created for the current
Animancer.SpriteRendererTextureSwap.Texture . |
DestroySprites |
void |
Destroys all the
System.Collections.Generic.Dictionary`2.Values .static
|
DestroySprites |
void |
Destroys all sprites created for the `texture`.
static
|
GetSpriteMap |
Dictionary |
Returns a cached dictionary mapping original sprites to duplicates using the specified `texture`.
static
|
LateUpdate |
void | |
OnValidate |
void | |
TrySwapTexture |
bool |
If the
UnityEngine.Sprite.texture is not already using the specified `texture`, this method replaces the
`sprite` with a cached duplicate which uses that `texture` instead.
static
|