Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不擅长数学,我需要编写一个脚本,上面写着“每 3 级,此事件就会触发”(级别是游戏中的角色级别)。
有人可以帮我解决这个问题吗?谢谢!您不必将其转换为代码,我可以只使用公式(或者它最容易解释!)
使用模运算符,它返回除法后的余数:
if (level % 3 == 0) { // do something }
希望我理解正确,你可以这样做:
If (level % 3 == 0) { Do your thing }