Created
May 30, 2023 06:57
-
-
Save hobione2k/89ced14c67718737bb31f43be552d8dc to your computer and use it in GitHub Desktop.
ClusterScript-一定間隔で実行
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const intervalTask = (name, interval, deltaTime) => { | |
const key = `intervalTask_${name}}`; | |
$.state[key] = ($.state[key] ?? interval) + deltaTime; | |
if ($.state[key] < interval) return false; | |
$.state[key] = 0; | |
return true; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使い方