AxibugEmuOnline/AxibugEmuOnline.Client/Assets/Script/UI/AutoRaycastCanvasGroup.cs
ALIENJACK\alien 2f5b5d9841 UI 迭代
2024-08-22 17:25:00 +08:00

19 lines
510 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace AxibugEmuOnline.Client
{
[RequireComponent(typeof(CanvasGroup))]
public class AutoRaycastCanvasGroup : MonoBehaviour
{
private CanvasGroup canvasGroup;
private void Update()
{
if (canvasGroup == null) canvasGroup = gameObject.GetComponent<CanvasGroup>();
canvasGroup.blocksRaycasts = canvasGroup.alpha == 0 ? false : true;
}
}
}