feat():添加传送器开启时的特效
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user