Sprite Factory

ReadMe
Release Notes
Overview
Using the Editor
Upgrading

Concepts
Sprites
Master Sprites
Sprite Groups
Colliders
Locators
Material Sets
SpriteUpdater
SpriteCamera

Advanced
Working in Multiple Projects

Classes
Runtime Classes

Videos
Overview
Creating Sprites
Sprite Inspector
Frame Events
Collision System
Locator System
Material Sets

Links
Sprite Factory Site
Web Documentation
Support
Contact

SpriteFactory.Sprite.currentMaterialSetIndex

C#: int currentMaterialSetIndex
JS: var currentMaterialSetIndex : int

Description
The index of the current material set used by the Sprite.

You can switch between material sets in the inspector, which will change the material used by the Sprite. However, to change material sets during gameplay via scripting, it's recommended you call ChangeMaterialSet instead. (The reason for this is that the change may take place 1 frame after assignment during gameplay by setting the variable, but the change takes place instantly when set via the aforementioned function.)

See Also
ChangeMaterialSet