public void SpawnEgg(Vector2 pos, int id, string team) { GameObject go = Instantiate(eggPrefab, map.GetRandomCasePos((int)pos.x, (int)pos.y) + new Vector3(0, 0.5f, 0), eggPrefab.transform.rotation, eggRoot); Egg newEgg = go.GetComponent <Egg>(); newEgg.id = id; newEgg.team = team; eggs.Add(newEgg); newEgg.Pop(); }