Files
JJBB/Assets/Project/Script/TeXiao/scripts/DelayControlHub.cs
2024-08-23 15:49:34 +08:00

24 lines
570 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
/// <summary>
/// 延迟组件清洗工具 - 如果自己被反激活就重置全部Delay组件
/// </summary>
public sealed class DelayControlHub : MonoBehaviour
{
private Delay[] _delays;
private void Awake()
{
_delays = GetComponentsInChildren<Delay>(true);
}
private void OnDisable()
{
if (_delays != null)
{
for (var i = 0; i < _delays.Length; i++)
{
if (_delays[i] != null)
_delays[i].ClearDelay();
}
}
}
}