r2mods/ilspy_dump/ror2_csproj/RoR2.UI/CurrentDifficultyIconContro...

18 lines
392 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
using UnityEngine.UI;
namespace RoR2.UI;
[RequireComponent(typeof(Image))]
internal class CurrentDifficultyIconController : MonoBehaviour
{
private void Start()
{
if ((bool)Run.instance)
{
DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(Run.instance.selectedDifficulty);
GetComponent<Image>().sprite = difficultyDef.GetIconSprite();
}
}
}