Interface ITimeSystem
시간 값 제공 및 Pause/Resume 제어 계약. Time.deltaTime 직접 참조 금지.
public interface ITimeSystem
Remarks
[규칙] 모든 Tick 기반 시간 계산은 이 인터페이스를 통해서만 접근한다. [금지] Time.deltaTime 직접 참조. Pause 상태에서 DeltaTime은 0을 반환한다.
Properties
DeltaTime
Pause 상태이면 0, 아니면 Time.deltaTime * TimeScale.
float DeltaTime { get; }
Property Value
- float
IsPaused
현재 Pause 상태 여부.
bool IsPaused { get; }
Property Value
- bool
TimeScale
시간 배율. 0 이상 값만 허용. 슬로우모션/패스트포워드에 사용.
float TimeScale { get; set; }
Property Value
- float
UnscaledDeltaTime
TimeScale·Pause 영향 없는 실제 경과 시간.
float UnscaledDeltaTime { get; }
Property Value
- float
Methods
Cancel(ScheduleId)
특정 스케줄 취소.
void Cancel(ScheduleId id)
Parameters
idScheduleId취소할 스케줄 ID.
CancelAll()
모든 스케줄 취소.
void CancelAll()
Delay(float, Action, CancellationToken)
지정 시간 후 1회 실행.
ScheduleId Delay(float time, Action action, CancellationToken ct = default)
Parameters
timefloat지연 시간(초).
actionAction실행할 액션.
ctCancellationToken취소 신호.
Returns
- ScheduleId
취소에 사용할 ScheduleId.
IsTimerReady(string)
해당 타이머가 준비 완료(경과 >= duration) 여부.
bool IsTimerReady(string id)
Parameters
idstring조회 키. 미등록 시 true 반환.
Returns
- bool
Pause()
시간 흐름 정지. DeltaTime이 0을 반환.
void Pause()
RegisterTimer(string, float)
쿨타임 등록. 이미 존재하는 id는 덮어쓴다.
void RegisterTimer(string id, float duration)
Parameters
idstring타이머 식별 키.
durationfloat쿨타임 지속 시간(초).
Repeat(float, Action, CancellationToken)
지정 간격으로 반복 실행. ct 취소 또는 Cancel 호출 시 중단.
ScheduleId Repeat(float interval, Action action, CancellationToken ct = default)
Parameters
intervalfloat반복 간격(초).
actionAction반복 실행할 액션.
ctCancellationToken취소 신호.
Returns
- ScheduleId
취소에 사용할 ScheduleId.
ResetTimer(string)
해당 타이머 경과 시간을 초기화.
void ResetTimer(string id)
Parameters
idstring리셋할 타이머 키.
Resume()
시간 흐름 재개.
void Resume()
UnregisterTimer(string)
타이머 등록 해제.
void UnregisterTimer(string id)
Parameters
idstring해제할 타이머 키.