|
发表于 2007-10-25 12:38:17
|
显示全部楼层
直接使用 GetUnitsSelectedAll 会有点麻烦,每次都会生成一个临时单位组
比较节省的方法是公用用一个空的全局单位组,然后在其filter 里执行
[codes=jass]globals
group CorlorfulSelectedUnits=null
endglobals
function varycolor takes nothing returns nothing
call SetUnitVertexColor(GetFilterUnit(),GetRandomInt(0,255),GetRandomInt(0,255),GetRandomInt(0,255),GetRandomInt(0,255))
endfunction
function ColorAction takes nothing returns nothing
call GroupEnumUnitsSelected(CorlorfulSelectedUnits,GetTriggerPlayer(),Filter(function varycolor))
call TriggerSleepAction(x)
call TriggerExecute(GetTriggeringTrigger())
endfunction
function InitColor takes nothing returns nothing
set CorlorfulSelectedUnits=CreateGroup()
.....
[/codes] |
|