0
如何在mouse_click事件中防止重複函數?如何在mouse_click事件XNA Gamestudio中防止重複函數?
if (Mouse.GetState().LeftButton == ButtonState.Pressed)
{
shoot_sound.Play();
// it plays the sound more than once
// i'd like to play it just once and stop !
// how to prevent key repeating
}
可一旦你點擊它分配一個全局變量1個或什麼都值,你不添加東西,將持有的空初始值或零當第一次加載,然後..然後如果if語句檢查值和調用shoot_sound.Play()else跳出..? – MethodMan 2014-09-19 17:43:01