Skip to content

Home > @esengine/ecs-framework-monorepo > Time

Time class

时间管理工具类 提供游戏时间相关的功能,包括帧时间、总时间、时间缩放等

Signature:

typescript
export declare class Time

Properties

Property

Modifiers

Type

Description

deltaTime

static

number

上一帧到当前帧的时间间隔(秒)

frameCount

static

number

当前帧数

timeScale

static

number

时间缩放比例

totalTime

static

number

游戏开始以来的总时间(秒)

unscaledDeltaTime

static

number

未缩放的帧时间间隔(秒)

unscaledTotalTime

static

number

未缩放的总时间(秒)

Methods

Method

Modifiers

Description

checkEvery(interval, lastTime)

static

检查指定的时间间隔是否已经过去

sceneChanged()

static

场景改变时重置时间

update(deltaTime)

static

使用外部引擎提供的deltaTime更新时间信息

基于 MIT 许可证发布