public void AddEnemyPart() { var wavePart = new Declarations.SpawnWavePart(Def.Instance.EnemyDictionary[0]); var index = WavePartList.transform.childCount - 1; var wavePartObject = Instantiate(EnemyPartPrefab, WavePartList.transform).GetComponent <WavePart>(); wavePartObject.SetData(index, currectWave, wavePart); wavePartObject.transform.SetSiblingIndex(index); currectWave.AddPart(wavePart, wavePartObject); }