Character Prefab
Library Serializable Script to have informations about each evolution(Id, name, Sprite for now)
Instances Script to get all Prefabs I need in the game
Ligne Code to check if two ID are the same I can merge them.
When 2 characters are merged I add a new Character Prefab at the position where I merged the characters with an ID +1.
I made the function to call a new Sprite from his ID.
This function looks like it:
public void ChangeSkin()
{
transform.GetChild(0).GetComponent<SpriteRenderer>().sprite = Script_Character_Library.Mine.Library[ID].Skin;
}
0 comments