private void PlayFile() { if (_TestMusic == -1) { _TestMusic = CSound.Load(Path.Combine(Environment.CurrentDirectory, "Test.mp3")); } CSound.Play(_TestMusic); CSound.Fade(_TestMusic, 100f, 2f); }
protected void SelectSong(int nr) { if (CSongs.Category >= 0 && (CSongs.NumVisibleSongs > 0) && (nr >= 0) && ((_actsong != nr) || (_streams.Count == 0))) { foreach (int stream in _streams) { CSound.FadeAndStop(stream, 0f, 1f); } _streams.Clear(); CVideo.VdClose(_video); _video = -1; CDraw.RemoveTexture(ref _vidtex); _actsong = nr; if (_actsong >= CSongs.NumVisibleSongs) { _actsong = 0; } int _stream = CSound.Load(Path.Combine(CSongs.VisibleSongs[_actsong].Folder, CSongs.VisibleSongs[_actsong].MP3FileName), true); CSound.SetStreamVolumeMax(_stream, _MaxVolume); CSound.SetStreamVolume(_stream, 0f); float startposition = CSongs.VisibleSongs[_actsong].PreviewStart; if (startposition == 0f) { startposition = CSound.GetLength(_stream) / 4f; } CSound.SetPosition(_stream, startposition); CSound.Play(_stream); CSound.Fade(_stream, 100f, 3f); _streams.Add(_stream); _actsongstream = _stream; if (CSongs.VisibleSongs[_actsong].VideoFileName != String.Empty && CConfig.VideoPreview == EOffOn.TR_CONFIG_ON) { _video = CVideo.VdLoad(Path.Combine(CSongs.VisibleSongs[_actsong].Folder, CSongs.VisibleSongs[_actsong].VideoFileName)); if (_video == -1) { return; } CVideo.VdSkip(_video, startposition, CSongs.VisibleSongs[_actsong].VideoGap); _VideoFadeTimer.Stop(); _VideoFadeTimer.Reset(); _VideoFadeTimer.Start(); } } }
private void TogglePause() { _Pause = !_Pause; if (_Pause) { Buttons[htButtons(ButtonCancel)].Visible = true; Buttons[htButtons(ButtonContinue)].Visible = true; CSound.Pause(_CurrentStream); } else { Buttons[htButtons(ButtonCancel)].Visible = false; Buttons[htButtons(ButtonContinue)].Visible = false; CSound.Play(_CurrentStream); } }
public void CreateBullet(Transform target, Transform trParent) { GameObject go = Instantiate(m_prefabBullet, trParent); go.transform.position = this.m_FireStartPos.position; go.transform.rotation = Quaternion.Euler(Vector3.zero); Bullet kBullet = go.GetComponent <Bullet>(); kBullet.Initialize(target, DBASE_BULLET_SPEED * m_BulletSpeed); if (m_kAudio != null) { m_kAudio.Play(); } if (m_FireFX != null) { m_FireFX.Play(); } }
private void StartSong() { PrepareTimeLine(); CSound.Play(_CurrentStream); CSound.RecordStart(); }