Files
TEngine/Assets/GameScripts/DotNet/Core/TimerScheduler/TimerAction.cs
ALEXTANG 0c8f3a5f92 [+] TEngineServer
[+] TEngineServer
2023-07-13 17:17:26 +08:00

31 lines
728 B
C#

using System;
using TEngine.Core;
#pragma warning disable CS8625
#pragma warning disable CS8618
namespace TEngine
{
public sealed class TimerAction : IDisposable
{
public long Id;
public long Time;
public object Callback;
public TimerType TimerType;
public static TimerAction Create()
{
var timerAction = Pool<TimerAction>.Rent();
timerAction.Id = IdFactory.NextRunTimeId();
return timerAction;
}
public void Dispose()
{
Id = 0;
Time = 0;
Callback = null;
TimerType = TimerType.None;
Pool<TimerAction>.Return(this);
}
}
}