修改穿透问题

This commit is contained in:
YangHua 2024-09-04 15:24:48 +08:00
parent b771e1d8fe
commit 551ce83487
1 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,7 @@ using HighlightPlus;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
/// <summary>
/// ÆÕͨÃÅ
@ -31,16 +32,19 @@ public class Door : MonoBehaviour
private void OnMouseDown()
{
if (EventSystem.current.IsPointerOverGameObject()) return;
isOpen = !isOpen;
transform.DOLocalRotate(dic[isOpen], duration);
}
private void OnMouseEnter()
{
if (EventSystem.current.IsPointerOverGameObject()) return;
highlightEffect.SetHighlighted(true);
}
private void OnMouseExit()
{
if (EventSystem.current.IsPointerOverGameObject()) return;
highlightEffect.SetHighlighted(false);
}