I'm instantiating several Prefabs of the same kind. These prefabs should be moving up and down. To make the animation I'm using iTween.
void Start () {
System.Random random = new System.Random();
int randomNumber = random.Next(0, 99);
float delay = (float) randomNumber / 100;
iTween.MoveBy(gameObject,iTween.Hash("y", 2,"time", 1, "looptype", "pingpong", "delay", 0));
}
It seems every clone of the Prefab is using exactly this script (Start only called once). What would the correct way to do this be?
↧