This is the old Animancer v7.4 documentation. Click here for the latest version.

SpriteRendererTextureSwap.

TrySwapTexture(Dictionary<Sprite, Sprite>, Texture2D, Sprite) Method

Summary

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.
Assembly
Animancer.dll
Namespace
Animancer
Containing Type
SpriteRendererTextureSwap

Syntax

public static bool TrySwapTexture(Dictionary<Sprite, Sprite> spriteMap, Texture2D texture, ref Sprite sprite)

Parameters

Name Type Description
spriteMap Dictionary<Sprite, Sprite>
texture Texture2D
sprite Sprite

Return Value

Type Description
bool