public void PlaySound(string soundFileName) { if (string.IsNullOrEmpty(soundFileName)) { return; } var path = string.Format("Sounds/{0}", soundFileName); GameUIScene.RunAction(SKAction.PlaySoundFileNamed(path, false)); }
public void PlayMusic(string soundFileName) { if (soundFileName == null) { return; } if (GameUIScene.GetActionForKey(soundFileName) != null) { return; } string path = string.Format("Sounds/{0}", soundFileName); SKAction repeatAction = SKAction.RepeatActionForever(SKAction.PlaySoundFileNamed(path, true)); GameUIScene.RunAction(repeatAction, soundFileName); }