Horje
unity 2d swap out background image Code Example
unity 2d swap out background image
//You can create a sprite and swap which sprite it is using currently.
//these can be set in editor
public GameObject sprite1;
public GameObject sprite2;

//put following code in function that changes sprites
//this sets both of these to be the opposite of their current state
//SetActive() will set the game object before it to the active state of the
//bool in the parameters.
//activeSelf returns the active state of the given game object
sprite1.SetActive(!sprite.activeSelf);
sprite2.SetActive(!sprite.activeSelf);




Csharp

Related
gridview edit update delete in asp.net textbox size Code Example gridview edit update delete in asp.net textbox size Code Example
xamarin c# switch on hotspot Programmatically Code Example xamarin c# switch on hotspot Programmatically Code Example
how to make a destroy reference in unity Code Example how to make a destroy reference in unity Code Example
Precision comparison in C# Code Example Precision comparison in C# Code Example
get xml from URL Code Example get xml from URL Code Example

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