|
发表于 2009-3-9 16:23:38
|
显示全部楼层
其实wow8编辑器文件夹下j文件里有的.......
比如下面一段:
[jass]
function TimerDestroyLightningActions takes nothing returns nothing
call DestroyLightning( GetHandleLightning( GetExpiredTimer(), "Lightning" ) )
call SetHandleHandle( GetExpiredTimer(), "Lightning", null )
call PauseTimer( GetExpiredTimer() )
call DestroyTimer( GetExpiredTimer() )
endfunction
function TimerDestroyLightning takes lightning lig, real period returns nothing
local timer t = null
if period <= 0.00 then
call DestroyLightning( lig )
elseif lig != null then
set t = CreateTimer()
call SetHandleHandle( t, "Lightning", lig )
call TimerStart( t, period, false, function TimerDestroyLightningActions )
set bj_lastStartedTimer = t
endif
set t = null
endfunction
[/jass]
看起来除了字符泄漏以外没有,嗯。用的是独立timer,但是最后会返回bj_lastStartedTimer,所以在使用 最后开始的计时器 时要稍微注意一下。 |
|