private void GenerateAchievement(Mod mod, string name, string description, Texture2D lockedtex, Texture2D unlockedtex, AchievementCategory category) { ModAchievement ach = new ModAchievement(); ach.mod = mod; ach.Name = name; ach.Description = description; ach.LockedTexture = lockedtex; ach.UnlockedTexture = unlockedtex; ach.Category = category; Achievement cheev = ach.GetAchievement(); FieldInfo cat = typeof(Achievement).GetField("_category", BindingFlags.NonPublic | BindingFlags.Instance); cat.SetValue(cheev, ach.Category); Achievements.Add(ach); }