private void OnAchievementCreated(object achievementIndex) { int i = (int)achievementIndex; AchievementUIMain element = Instantiate(UIprefab, transform, false) as AchievementUIMain; element.Init(GlobalData.instance.gameData.achievementsUI[i], i); }