写法1:
复制程式
new const skill_sound[] = { "events/cong_slotin.wav", "events/powerup.wav" }
for (i = 0; i < sizeof skill_sound; i++)
precache_sound(skill_sound[i])
engfunc(EngFunc_EmitSound, id, CHAN_BODY, skill_sound[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
engfunc(EngFunc_EmitSound, id, CHAN_BODY, skill_sound[1], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
写法2:
复制程式
new const skill_sound1[] = { "events/cong_slotin.wav" }
new const skill_sound2[] = { "events/powerup.wav" }
precache_sound(skill_sound1)
precache_sound(skill_sound2)
engfunc(EngFunc_EmitSound, id, CHAN_BODY, skill_sound1, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
engfunc(EngFunc_EmitSound, id, CHAN_BODY, skill_sound2, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
两个写法是有分别的么?
先感谢一下