找回密码
 点一下
查看: 1259|回复: 4

算了,自己做好了。

[复制链接]
发表于 2009-3-11 14:38:16 | 显示全部楼层 |阅读模式
作废。
 楼主| 发表于 2009-3-11 14:38:46 | 显示全部楼层
还有,用正常的GC系统,不要使用VJ之类的东西。
回复

使用道具 举报

发表于 2009-3-11 16:29:30 | 显示全部楼层
[codes=jass]globals
    real MG_Volume
    real MG_Time
    gamecache gc = null
endglobals

function Init takes nothing returns nothing
    call FlushGameCache( InitGameCache( "gc.w3v" ) )
    set gc = InitGameCache( "gc.w3v" )
endfunction

function H2I takes handle h returns integer
    return h
    return 0
endfunction

function I2U takes integer i returns unit
    return i
    return null
endfunction

function MG_DE takes nothing returns nothing
    local timer ti = GetExpiredTimer()
    local real vol = GetStoredReal( gc, I2S( H2I( ti ) ), "MG_Volume" )
    call SetUnitScale( I2U( GetStoredInteger( gc, I2S( H2I(ti) ), "u" ) ), 1 / MG_Volume, 1 / MG_Volume, 1 / MG_Volume )
    call FlushStoredMission( gc, I2S( H2I( ti ) ) )
    call PauseTimer( ti )
    call DestroyTimer( ti )
    set ti = null
endfunction

function MG takes unit u returns nothing
    local timer ti = CreateTimer()
    call StoreReal( gc, I2S( H2I(ti) ), "MG_Volume", MG_Volume )
    call StoreInteger( gc, I2S( H2I(ti) ), "u", H2I( u ) )
    call SetUnitScale( u, MG_Volume, MG_Volume, MG_Volume )
    call TimerStart( ti, MG_Time, false, function MG_DE )
    set ti = null
endfunction[/codes]
给你,具体自己调~~
回复

使用道具 举报

 楼主| 发表于 2009-3-11 20:20:41 | 显示全部楼层
哦,非常感谢。
回复

使用道具 举报

 楼主| 发表于 2009-3-11 20:27:20 | 显示全部楼层
这个函数。。。
我原来还指望要一个loop的判定
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-5-2 08:55 , Processed in 0.065672 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表