Well, I have this lil’ player, and he can be type 1 (A black suit) and type 2 (A green suit), I dont know why my code does not work. Does the Generic Sytem Collection has to do with this? because I am using it, and I think my problem has to do with it.
public Sprite BSuit; //Black Suit sprite
public Sprite GSuit; //Green Suit sprite
private SpriteRenderer RendererOSprites; //Sprite Renderer Component
private int Type; //Type variable
void Start()
{
Type = Random.Range(1, 3); // Player does not choose the color of the suit
Debug.Log("" + Type); // Just to see what was chosen
RendererOSprites = GetComponent<SpriteRenderer>(); //Set the Renderer O' Sprites to the SpriteRenderer
if (Type == 1)
{ RendererOSprites.sprite = BSuit; } //Set Black suit if type is 1
if (Type == 2)
{ RendererOSprites.sprite = GSuit; } //Set Green Suit if type is 2
}
By default, in the editor, I set the sprite renderer to have BSuit sprite, and it never changes, the Debug Log shows correctly numbers 1 or 2 upon startup, but the sprite does not change, also if I remove the sprites of the SpriteRenderer in the editor, it never aquires a sprite.
Plz help