unity object change sprite code example
Example: unity object change sprite
public SpriteRenderer spriteRenderer;
public Sprite newSprite;
void ChangeSprite()
{
spriteRenderer.sprite = newSprite;
}Copied!
public SpriteRenderer spriteRenderer;
public Sprite newSprite;
void ChangeSprite()
{
spriteRenderer.sprite = newSprite;
}Copied!