Created
September 3, 2014 19:37
-
-
Save antonkudin/129fd83d401015686589 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sprite tempSprite; | |
SpriteRenderer changeSprite; | |
void Update(){ | |
changeSprite = gameObject.GetComponent<SpriteRenderer>(); | |
switch(type){ | |
case 0: | |
tempSprite = Resources.Load<Sprite>("tiles-wall_brick"); | |
changeSprite.sprite=tempSprite; | |
break; | |
default: | |
tempSprite = Resources.Load<Sprite>("genericbox"); | |
changeSprite.sprite=tempSprite; | |
break; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment