24 lines
570 B
C#
24 lines
570 B
C#
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();
|
||
}
|
||
}
|
||
}
|
||
} |