HeavenStudioPlus/Assets/Scripts/LevelEditor/DisableSelectOnHover.cs
2022-02-28 18:18:06 -07:00

25 lines
No EOL
749 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
namespace RhythmHeavenMania.Editor
{
public class DisableSelectOnHover : MonoBehaviour
{
public EventParameterManager eventParameterManager;
// this is programmed on duct tape https://youtu.be/zMWA0ipQ94w?t=868
private void LateUpdate()
{
eventParameterManager.canDisable = true;
for (int i = 0; i < transform.childCount; i++)
{
if (Editor.MouseInRectTransform(transform.GetChild(i).GetComponent<RectTransform>()))
{
eventParameterManager.canDisable = false;
}
}
}
}
}