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

27 lines
556 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
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);
}
}
}