public static Error Loop2dSound(int _track) { AudioSource source = null; if (!pool2D.TryGetValue(_track, out source)) { return(AppError.NewAccessErr("2D Audio Source {0} is not exists", _track)); } source.loop = true; return(AppError.OK); }
public static Error Stop2dSound(int _track) { AudioSource source = null; if (!pool2D.TryGetValue(_track, out source)) { return(AppError.NewAccessErr("2D Audio Source {0} is not exists", _track)); } source.Stop(); source.gameObject.SetActive(false); return(AppError.OK); }
public static Error Play2dSound(int _track, AudioClip _clip) { AudioSource source = null; if (!pool2D.TryGetValue(_track, out source)) { return(AppError.NewAccessErr("2D Audio Source {0} is not exists", _track)); } source.gameObject.SetActive(true); source.clip = _clip; source.Play(); return(AppError.OK); }
public static Error Play3dSound(Vector3 _position, int _track, AudioClip _clip) { AudioSource source = null; if (!pool3D.TryGetValue(_track, out source)) { return(AppError.NewAccessErr("3D Audio Source {0} is not exists", _track)); } source.gameObject.SetActive(true); source.transform.position = _position; source.clip = _clip; source.Play(); return(AppError.OK); }