r2mods/ilspy_dump/ror2_csproj/EntityStates.Missions.Artif.../FinishTrial.cs

26 lines
674 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using UnityEngine;
namespace EntityStates.Missions.ArtifactWorld.TrialController;
public class FinishTrial : ArtifactTrialControllerBaseState
{
[SerializeField]
public string achievementName;
public override void OnEnter()
{
base.OnEnter();
childLocator.FindChild("FinishTrial").gameObject.SetActive(value: true);
AchievementDef achievementDef = AchievementManager.GetAchievementDef(achievementName);
if (achievementDef == null)
{
return;
}
foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList)
{
AchievementManager.GetUserAchievementManager(readOnlyLocalUsers).GrantAchievement(achievementDef);
}
}
}