0

现在我正在为角色制作技能,我想添加冷却时间,但我不知道如何设置时间,但我想我知道它应该有哪些变量:

private long currentTime; <-- this is the actual cooldown
private long cooldownTime; <--- this is the time it must pass before its ready
private boolean onCooldown; <---- game uses this to check if its on cooldown
private long elapsed = System.nanoTime(); <-- this takes the exact time when a skill is used and is setOnCooldown.

所以这是基本变量,但我完全不知道如何设置它们,我在游戏中有一个 update() 方法,一个 cast() 方法。请前辈停止!为任何愿意停止的人提供巧克力饼干

4

1 回答 1

0
于 2017-02-07T03:25:36.150 回答