mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-30 07:50:22 +00:00
37 lines
755 B
C#
37 lines
755 B
C#
using System.Collections;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
namespace SanAndreasUnity.Utilities
|
|
{
|
|
|
|
public class CustomEventSystemForMixingIMGUIAndNewUI : EventSystem
|
|
{
|
|
bool m_wasAnyElementActiveLastFrame = false;
|
|
|
|
|
|
protected override void Start()
|
|
{
|
|
base.Start();
|
|
|
|
StartCoroutine(this.Coroutine());
|
|
}
|
|
|
|
IEnumerator Coroutine()
|
|
{
|
|
while (true)
|
|
{
|
|
yield return null;
|
|
m_wasAnyElementActiveLastFrame = GUIUtility.hotControl != 0;
|
|
}
|
|
}
|
|
|
|
protected override void Update()
|
|
{
|
|
if (!m_wasAnyElementActiveLastFrame)
|
|
base.Update();
|
|
}
|
|
|
|
}
|
|
|
|
}
|