// Use this for initialization void Start() { this.player = beeba.GetComponent<Beeba>(); for (int i = 0; i < this.player.life; i++) { var obj = Instantiate(this.life) as GameObject; obj.transform.parent = this.transform; obj.name = "" + i; lifes.Add(obj); } }
// Use this for initialization void Start() { this.beeba = beebaObj.GetComponent<Beeba>(); }