Horje
unity change sprite source image Code Example
unity change sprite source image
using System.Collections;
using System.Collections.Generic;
using UnityEngine.SceneManagement;
using UnityEngine;
using UnityEngine.UI;

private SpriteRenderer old_sprite_img;
public Sprite new_sprite_img;//USE INSPECTOR TO PUT THE NEW IMG SOURCE


void start()
{
  //FIND YOUR OBJECT TO CHANGE THE IMG
object_compoent = GameObject.FindWithTag("your_tag_name");


old_sprite_img = object_compoent.GetComponent<SpriteRenderer>();
old_sprite_img.sprite = new_sprite_img;
}




Csharp

Related
unity camera follow player 3d smooth Code Example unity camera follow player 3d smooth Code Example
unity c# set list to set active true Code Example unity c# set list to set active true Code Example
c# long to int Code Example c# long to int Code Example
linux command line switch statement Code Example linux command line switch statement Code Example
move towards target unity Code Example move towards target unity Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12