Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

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 :: c# add to start of list 
Csharp :: c# double value with 2 decimal places 
Csharp :: c# connection string 
Csharp :: set active text unity 
Csharp :: c# get file extension 
Csharp :: ef core dbfirst 
Csharp :: unity conditional field 
Csharp :: c# socket receive 
Csharp :: get string name of dropdown in unity 
Csharp :: how to store more precise data then double c# 
Csharp :: c# write text before user input 
Csharp :: unity get velocity of gameobject 
Csharp :: c# take only int from string 
Csharp :: maxheap c# 
Csharp :: how to write switch statement unity 
Csharp :: C# data table primary key from 2 columns 
Csharp :: hello in c# 
Csharp :: c# add 1 
Csharp :: play sound unity 
Csharp :: move file from one folder to another c# 
Csharp :: renaming table name entity framework code first fluent api 
Csharp :: make an object disappear from a c# script unity 
Csharp :: unity move object to mouse position 
Csharp :: c# list join 
Csharp :: how to get the path of the current directory in c# 
Csharp :: c# return list 
Csharp :: prettier c# 
Csharp :: get normal from 3 points 
Csharp :: c# winforms textbox to int 
Csharp :: c# get class name by type 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =