feat():添加传送器开启时的特效

This commit is contained in:
2025-10-30 15:51:48 +08:00
parent 6392fd90b5
commit 5cb49f1b4b
3 changed files with 4942 additions and 25 deletions

View File

@@ -15,10 +15,16 @@ namespace Script.Gameplay.Facility
[SerializeField] private float detectHeight = 2.0f;
[SerializeField] private LayerMask playerLayer;
[SerializeField] private GameObject particleEffect;
private bool canTransport = false;
private bool isTransporting = false;
private Collider[] hits;
private void Awake()
{
particleEffect.SetActive(false);
}
// 接收信号,决定是否允许传送
public override void OnSignalReceived(bool active, GameObject sender)
{
@@ -37,6 +43,14 @@ namespace Script.Gameplay.Facility
private void Update()
{
if (!isOpenInEditor || !canTransport || destinationPoint == null || hits == null) return;
if (canTransport)
{
particleEffect.SetActive(true);
}
else
{
particleEffect.SetActive(false);
}
foreach (var hit in hits)
{
if (hit.CompareTag(playerTag) && !isTransporting)