com.alicizax.unity.framework/Runtime/Timer/ITimerModule.cs
2025-12-24 14:34:26 +08:00

24 lines
851 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 System;
using System.Collections.Generic;
using AlicizaX;
namespace AlicizaX
{
[UnityEngine.Scripting.Preserve]
public interface ITimerModule : IModule, IModuleUpdate
{
int AddTimer(TimerHandler callback, float time, bool isLoop = false, bool isUnscaled = false, params object[] args);
int AddTimer(TimerHandlerNoArgs callback, float time, bool isLoop = false, bool isUnscaled = false);
// 优化1: 使用值类型泛型参数完全零GC
int AddTimer<T>(Action<T> callback, T arg, float time, bool isLoop = false, bool isUnscaled = false);
void Stop(int timerId);
void Resume(int timerId);
bool IsRunning(int timerId);
float GetLeftTime(int timerId);
void Restart(int timerId);
void RemoveTimer(int timerId);
void RemoveAllTimer();
}
}