Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

change sprite of gameobject unity

gameObjectName.GetComponent<SpriteRenderer>().sprite = spriteName;
Comment

unity ui change sprite

// TO change the sprite of an UI image, se below
GameObject.GetComponent<Image>().sprite = sprite;
Comment

change sprite of a sprite unity

public SpriteRenderer spriteRenderer;
public Sprite newSprite;

void ChangeSprite()
    {
        spriteRenderer.sprite = newSprite; 
    }
Comment

unity object change sprite

public SpriteRenderer spriteRenderer;
public Sprite newSprite;

void ChangeSprite()
    {
        spriteRenderer.sprite = newSprite; 
    }Copied!
Comment

PREVIOUS NEXT
Code Example
Csharp :: covert char[] to string C# 
Csharp :: asking for user input integer c# 
Csharp :: how to move a gameobject to another object 
Csharp :: c# foreach dictionary 
Csharp :: c# size of enum 
Csharp :: csharp 
Csharp :: movement unity 
Csharp :: how to make a mouse down condition in C# 
Csharp :: dotnet new project 
Csharp :: unity find gameobject 
Csharp :: 2d list in c# 
Csharp :: c# get getter set setter method 
Csharp :: copy 2d arrays C# 
Csharp :: csharp sleep code 1 second 
Csharp :: c# unity get name of object 
Csharp :: implement custom string to datetime convert net core 
Csharp :: serilog set log level 
Csharp :: c# string tob64 
Csharp :: c# datagridview selected row index 
Csharp :: c# windows forms print 
Csharp :: asp.net file detect mime type 
Csharp :: c# messagebox result 
Csharp :: switch case in c# with multiple values 
Csharp :: c# add string to array 
Csharp :: c# xor byte array 
Csharp :: divide string in chunks c# 
Csharp :: c# double to int 
Csharp :: calculate distance using latitude and longitude c# 
Csharp :: dicionário c# foreach keyvaluepair 
Csharp :: remove all array elements c# 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =