|
无解释,对TriggerExecute和ExecuteFunc效率深恶痛绝滴童鞋可以看看。
使用ExecuteBoolexpr函数可以方便地执行某个Boolexpr
globals
boolexpr array SYS_Boolexpr
boolean SYS_BoolexprResult = false
endglobals
function SetBoolexprResult takes nothing returns nothing
set SYS_BoolexprResult = true
endfunction
function ExecuteBoolexpr takes boolexpr be returns boolean
set SYS_BoolexprResult = false
call EnumDestructablesInRect(SYS_Rect_ForBoolexpr,be,function SetBoolexprResult)
return SYS_BoolexprResult
endfunction
function DestructablesConfig takes nothing returns nothing
call Print("find")
call RemoveDestructable(GetFilterDestructable())
endfunction
function InitBoolexprSystem takes integer dId returns nothing
local rect r = GetWorldBounds()
local boolexpr be = Condition(function DestructablesConfig)
local destructable dst
local real x = GetRectMinX(r)+50.0
local real y = GetRectMinY(r)+50.0
set SYS_Rect_ForBoolexpr = Rect(x,y,x+150.0,y+150.0)
call EnumDestructablesInRect(SYS_Rect_ForBoolexpr,be,null)
set dst = CreateDestructable(dId,GetRectCenterX(SYS_Rect_ForBoolexpr),GetRectCenterY(SYS_Rect_ForBoolexpr),0,0,0)
call SetDestructableInvulnerable(dst,true)
call DestroyBoolExpr(be)
set be = null
set r = null
endfunction |
评分
-
查看全部评分
|