iOS设备震动函数改为输入1|2|3三档而不是时间(适配自改love,原版love都是固定振动)

框架不再使用不属于自己的SYSTEM的变量
This commit is contained in:
MrZ626
2021-10-24 04:45:34 +08:00
parent 716c44746b
commit 2db147461c
3 changed files with 14 additions and 8 deletions

View File

@@ -1,6 +1,12 @@
local level={0,0,.01,.016,.023,.03,.04,.05,.06,.07,.08,.09,.12,.15}
local vib=love.system.vibrate
return function(t)
t=level[t]
if t then vib(t)end
end
return love.system.getOS()=='iOS'and
function(t)
t=level[t]
if t then vib(t<=.03 and 1 or t<=.09 and 2 or 3)end
end
or
function(t)
t=level[t]
if t then vib(t)end
end