r2mods/ilspy_dump/ror2_csproj/RoR2.UI/ViewableTrigger.cs

27 lines
556 B
C#

using UnityEngine;
namespace RoR2.UI;
public class ViewableTrigger : MonoBehaviour
{
[Tooltip("The name of the viewable to mark as viewed when this component becomes enabled.")]
public string viewableName;
private void OnEnable()
{
TriggerView(viewableName);
}
public static void TriggerView(string viewableName)
{
if (string.IsNullOrEmpty(viewableName))
{
return;
}
foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList)
{
readOnlyLocalUsers.userProfile.MarkViewableAsViewed(viewableName);
}
}
}