public void PlaySoundDrawCard(int type, EPlayState state) { if (oldState == EPlayState.force && sourceCardDraw.isPlaying) { return; } if (state == EPlayState.force) { sourceCardDraw.Stop(); } _length = cardDrawEffect[type].length; sourceCardDraw.clip = cardDrawEffect[(int)type]; sourceCardDraw.loop = false; switch (state) { case EPlayState.fadingOut: sTween.audioTo(gameObject, fadeTime, 0, 0, null); break; case EPlayState.loop: sourceCardDraw.loop = true; break; } sourceCardDraw.Play(); oldState = state; }
public void PlayCardSound(CipCardSoundEffect type, EPlayState state) { if (oldState == EPlayState.force && AudioSourceCardsourceEffect.isPlaying) { return; } if (state == EPlayState.force) { AudioSourceCardsourceEffect.Stop(); } _length = AudioClipCardSoundEffect[(int)type].length; AudioSourceCardsourceEffect.clip = AudioClipCardSoundEffect[(int)type]; AudioSourceCardsourceEffect.loop = false; switch (state) { case EPlayState.fadingOut: sTween.audioTo(gameObject, fadeTime, 0, 0, null); break; case EPlayState.loop: AudioSourceCardsourceEffect.loop = true; break; } AudioSourceCardsourceEffect.Play(); oldState = state; }
private DsROTEntry m_ds_rot; // Allow you to "Connect to remote graph" from GraphEdit #endif public Video() { m_shutdown_lock = new object(); m_controls_lock = new object(); m_shutdown = false; m_play_state = EPlayState.Init; }
/// <summary>Stop the video/audio file</summary> public void Stop() { lock (m_controls_lock) { if (PlayState != EPlayState.Running && PlayState != EPlayState.Paused && PlayState != EPlayState.Init) { return; } if (m_media_ctrl != null) { DsError.ThrowExceptionForHR(m_media_ctrl.Stop()); } PlayState = EPlayState.Stopped; } }