public override void execute() { GameScene gameScene = mReceiver as GameScene; GameSceneComponentAudio audio = gameScene.getComponent(out audio); audio?.setVolume(mVolume); }
public override void execute() { GameScene gameScene = mReceiver as GameScene; GameSceneComponentAudio component = gameScene.getComponent(out component); component?.stop(); }
public override void execute() { GameScene gameScene = mReceiver as GameScene; GameSceneComponentAudio audio = gameScene.getFirstActiveComponent <GameSceneComponentAudio>(); if (audio != null) { audio.setVolume(mVolume); } }
public override void execute() { GameScene gameScene = (mReceiver) as GameScene; GameSceneComponentAudio audioComponent = gameScene.getFirstActiveComponent <GameSceneComponentAudio>(); if (audioComponent != null) { audioComponent.stop(); } }
protected void setVolume(float volume) { MathUtility.clamp(ref volume, 0.0f, 1.0f); mScriptVolumeSetting.setVolume(volume); mGameSetting.setCurVolume(volume); mGameSetting.applyToConfig(); GameTools.PLAY_AUDIO_UI(mScriptGlobalAudio.getAudioWindow(), SOUND_DEFINE.SD_CLICK_BUTTON); GameScene gameScene = mGameSceneManager.getCurScene(); GameSceneComponentAudio componentAudio = gameScene.getFirstActiveComponent <GameSceneComponentAudio>(); componentAudio.setVolume(volume); }
public override void execute() { GameScene gameScene = mReceiver as GameScene; GameSceneComponentAudio component = gameScene.getComponent(out component); string soundName = mSound != SOUND_DEFINE.SD_MAX ? mAudioManager.getAudioName(mSound) : mSoundFileName; if (mUseVolumeCoe) { mVolume *= mAudioManager.getVolumeScale(mSound); } component.play(soundName, mLoop, mVolume); }
public override void execute() { GameScene gameScene = mReceiver as GameScene; GameSceneComponentAudio audioComponent = gameScene.getFirstActiveComponent <GameSceneComponentAudio>(); if (audioComponent != null) { string soundName = mSound != SOUND_DEFINE.SD_MAX ? mAudioManager.getAudioName(mSound) : mSoundFileName; if (mUseVolumeCoe) { mVolume *= mAudioManager.getVolumeScale(mSound); } audioComponent.play(soundName, mLoop, mVolume); } }
public override void execute() { GameScene gameScene = (mReceiver) as GameScene; GameSceneComponentAudio audioComponent = gameScene.getFirstActiveComponent <GameSceneComponentAudio>(); if (audioComponent != null) { string soundName; if (mSound != SOUND_DEFINE.SD_MIN) { soundName = ComponentAudio.getAudioName(mSound); } else { soundName = mSoundFileName; } audioComponent.play(soundName, mLoop, mVolume); } }