寫法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)
兩個寫法是有分別的麼?
先感謝一下