Ändern Sie Sprite of GameObject Unity
gameObjectName.GetComponent<SpriteRenderer>().sprite = spriteName;
Sealest
gameObjectName.GetComponent<SpriteRenderer>().sprite = spriteName;
public SpriteRenderer spriteRenderer;
public Sprite newSprite;
void ChangeSprite()
{
spriteRenderer.sprite = newSprite;
}Copied!