forked from sin365/AxibugEmuOnline
17 lines
432 B
C#
17 lines
432 B
C#
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;
|
|
}
|
|
}
|
|
}
|