|
发表于 2009-10-2 10:40:59
|
显示全部楼层
虽然还不清楚这玩意是怎么让单位随意旋转XYZ轴的角度的。
但是可以确定的是,这是用单位弄的。
很恶心的发现是能够旋转角度的原理代码(没准?):
[jass]
static method New takes real minx, real maxy, real W, real H, real z, integer texture returns PICTURE
local PICTURE this = PICTURE.create()
local destructable tree
set .CostumValue = 0
set .Camera = 0
set .width = W
set .height = H
set .centerx = minx+W/2.0
set .centery = maxy-H/2.0
set .z = 100.2+z
set .show = false
set .picture = CreateUnit(Player(15), TypeUnit, 0, 0, 0)
call UnitAddAbility(.picture, TypeSkinChanger)
if (texture != 0) then
set tree = CreateDestructable(texture,0,0,0,0,1)
call IssueTargetOrder(.picture, "grabtree", tree)
call RemoveDestructable(tree)
set tree = null
endif
set .indexanim = FineIndexAnimModel(W, H, .z)
call SetUnitAnimationByIndex(.picture, .indexanim)
call SetUnitScale(.picture, FineSizeModel(W, H, .z), 0, 0)
call UnitAddAbility(.picture, 'Aave')
call UnitRemoveAbility(.picture, 'Aave')
call UnitAddAbility(.picture, 'Aloc')
call UnitRemoveAbility(.picture, 'Aloc')
call ShowUnit(.picture, false)
return this
endmethod
[/jass]
Aave经查是破坏者形态。
Aloc蝗虫。
grabtree是拔树。貌似应该是切换单位的种族风格的东西。
至于转角度的问题嘛…………
这三句:
[jass]
set .indexanim = FineIndexAnimModel(W, H, .z)
call SetUnitAnimationByIndex(.picture, .indexanim)
call SetUnitScale(.picture, FineSizeModel(W, H, .z), 0, 0)
[/jass] |
|