Files
Cielonos/Assets/OtherPlugins/Feel/MMTools/Accessories/MMGUI/MMGetFocusOnEnable.cs
SoulliesOfficial ef7b479712 initial
2025-11-25 08:19:33 -05:00

22 lines
522 B
C#

#if MM_UI
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using MoreMountains.Tools;
using UnityEngine.EventSystems;
namespace MoreMountains.Tools
{
/// <summary>
/// Add this helper to an object and focus will be set to it on Enable
/// </summary>
[AddComponentMenu("More Mountains/Tools/GUI/MM Get Focus On Enable")]
public class MMGetFocusOnEnable : MonoBehaviour
{
protected virtual void OnEnable()
{
EventSystem.current.SetSelectedGameObject(this.gameObject, null);
}
}
}
#endif