mardi 6 décembre 2016

Unity C# let code randomly choose between 2 outcomes

When my enemy dies I am using this to play the dead animation:

transform.GetChild(0).GetComponent<Animator>().Play("Death_01");

I want to let the code pick between "Death_01"or"Death_02".

What would be the easyest way for doing this? (Array, random number, OR,..)

Thanks




Aucun commentaire:

Enregistrer un commentaire