public void SetPitch(AudioHandle handle, float pitch) { AudioSourceInfo sourceInfo = GetSourceInfo(handle); if (sourceInfo != null) { sourceInfo.Source.pitch = pitch; } }
public string GetClipId(AudioHandle handle) { AudioSourceInfo sourceInfo = GetSourceInfo (handle); if (sourceInfo != null) { return sourceInfo.ClipId; } return string.Empty; }
public bool IsPlaying(AudioHandle handle) { AudioSourceInfo sourceInfo = GetSourceInfo(handle); if (sourceInfo != null) { return(sourceInfo.Source.isPlaying); } return(false); }
public string GetClipId(AudioHandle handle) { AudioSourceInfo sourceInfo = GetSourceInfo(handle); if (sourceInfo != null) { return(sourceInfo.ClipId); } return(string.Empty); }
public float GetVolume(AudioHandle handle) { AudioSourceInfo sourceInfo = GetSourceInfo(handle); if (sourceInfo != null) { return(sourceInfo.Source.volume); } return(0.0f); }
public float GetPitch(AudioHandle handle) { AudioSourceInfo sourceInfo = GetSourceInfo(handle); if (sourceInfo != null) { return(sourceInfo.Source.pitch); } return(1.0f); }
private AudioSourceInfo GetSourceInfo(AudioHandle handle) { if (handle.Id != AudioHandle.INVALID_ID) { AudioSourceInfo sourceInfo = _sourceInfos [handle.Index]; // Verify handle integrity. if (sourceInfo.HandleId == handle.Id) { return(sourceInfo); } } return(null); }
public void Stop(AudioHandle handle, float fadeOutTime) { AudioSourceInfo sourceInfo = GetSourceInfo(handle); if (sourceInfo != null) { if (fadeOutTime > 0.0f && !_isMuted) { sourceInfo.VolumeFluctuationSpeed = -sourceInfo.Source.volume / fadeOutTime; sourceInfo.TargetVolume = 0.0f; } else { sourceInfo.Source.Stop(); } } }
public void SetVolume(AudioHandle handle, float volume, float duration) { AudioSourceInfo sourceInfo = GetSourceInfo(handle); if (sourceInfo != null) { if (duration > 0.0f && !_isMuted) { float deltaVolume = volume - sourceInfo.Source.volume; sourceInfo.VolumeFluctuationSpeed = deltaVolume / duration; sourceInfo.TargetVolume = volume; } else { SetSourceVolume(sourceInfo, volume); } } }
public Uzu.AudioHandle PlayBgm(string clipId, bool loop = true) { if (loop && clipId == _last_clipid) { return _activeBGMHandle; } _last_clipid = clipId; StopBgm(); // Play sound. { Uzu.AudioController.PlayOptions options = new Uzu.AudioController.PlayOptions (); options.Loop = loop; options.Volume = BGM_VOLUME; options.FadeInTime = FADE_IN_TIME; _activeBGMHandle = _audioController.Play (clipId, options); } return _activeBGMHandle; }
public override void OnEnter(Uzu.PanelEnterContext context) { _bgm_handle = Main.AudioController.PlayBgm(AudioClipIds.BGM_MAIN_LOOP); _bgm_handle._handle_audio_source.outputAudioMixerGroup = _bgm_mixer_group; _audio_normal_snapshot = _bgm_mixer_group.audioMixer.FindSnapshot("Normal"); _audio_paused_snapshot = _bgm_mixer_group.audioMixer.FindSnapshot("Paused"); this.bgm_audio_set_paused_mode(false); gameObject.SetActive(true); _home_score.set_string("0"); _home_score.set_string("0"); _time_text.set_string("0:00:00"); set_pause_icon_alpha(0); _tar_pause_icon_alpha = 0; _quarter_text.set_string(Main.LevelController._quarter_display); //Main.LevelController.StartLevel(); _fadein.set_alpha(1.0f); _fadein.set_target_alpha(0.0f); }
public AudioHandle Play(string clipId, PlayOptions options) { AudioClip clip = GetClip(clipId); if (clip != null) { AudioHandle handle = GetSource(); AudioSourceInfo sourceInfo = GetSourceInfo(handle); if (sourceInfo != null) { AudioSource source = sourceInfo.Source; source.clip = clip; source.loop = options.Loop; source.transform.localPosition = options.Position; sourceInfo.ClipId = clipId; sourceInfo.TargetVolume = options.Volume; if (options.FadeInTime > 0.0f && !_isMuted) { sourceInfo.VolumeFluctuationSpeed = sourceInfo.TargetVolume / options.FadeInTime; source.volume = 0.0f; } else { SetSourceVolume(sourceInfo, sourceInfo.TargetVolume); } source.Play(); handle._handle_audio_source = source; } return(handle); } return(new AudioHandle()); }
public override void OnEnter(Uzu.PanelEnterContext context) { Main.GameCamera.gameObject.SetActive(false); Main.Instance._tvCamera.gameObject.SetActive(false); Main.Instance._titleCamera.transform.parent.gameObject.SetActive(true); gameObject.SetActive(true); _intro_bgm_handle = Main.AudioController.PlayBgm(AudioClipIds.BGM_MENU_INTRO, false); sprite_set_alpha(_spotco_logo, 0); sprite_set_alpha(_mnm_base, 1); sprite_set_alpha(_mnm_logo, 1); sprite_set_y(_mnm_logo, -280); sprite_set_alpha(_mnm_base, 1); sprite_set_alpha(_cover, 1); sprite_set_alpha(_click_anywhere_to_start, 0); sprite_set_alpha(_credits, 0); _camera_fade.set_alpha(1); _camera_fade.set_target_alpha(1); _current_state = TitleState.SpotcoLogoIn; _anim_t = 0; }
public override void OnEnter(Uzu.PanelEnterContext context) { Main.GameCamera.gameObject.SetActive(false); Main.Instance._tvCamera.gameObject.SetActive(false); Main.Instance._titleCamera.transform.parent.gameObject.SetActive(true); gameObject.SetActive(true); _intro_bgm_handle = Main.AudioController.PlayBgm(AudioClipIds.BGM_MENU_INTRO,false); sprite_set_alpha(_spotco_logo,0); sprite_set_alpha(_mnm_base,1); sprite_set_alpha(_mnm_logo,1); sprite_set_y(_mnm_logo,-280); sprite_set_alpha(_mnm_base,1); sprite_set_alpha(_cover,1); sprite_set_alpha(_click_anywhere_to_start,0); sprite_set_alpha(_credits,0); _camera_fade.set_alpha(1); _camera_fade.set_target_alpha(1); _current_state = TitleState.SpotcoLogoIn; _anim_t = 0; }
public bool IsHandleValid(AudioHandle handle) { return GetSourceInfo (handle) != null; }
public bool IsHandleValid(AudioHandle handle) { return(GetSourceInfo(handle) != null); }
public void SetPitch(AudioHandle handle, float pitch) { AudioSourceInfo sourceInfo = GetSourceInfo (handle); if (sourceInfo != null) { sourceInfo.Source.pitch = pitch; } }
public void SetVolume(AudioHandle handle, float volume) { SetVolume (handle, volume, 0.0f); }
public void SetVolume(AudioHandle handle, float volume, float duration) { AudioSourceInfo sourceInfo = GetSourceInfo (handle); if (sourceInfo != null) { if (duration > 0.0f && !_isMuted) { float deltaVolume = volume - sourceInfo.Source.volume; sourceInfo.VolumeFluctuationSpeed = deltaVolume / duration; sourceInfo.TargetVolume = volume; } else { SetSourceVolume (sourceInfo, volume); } } }
public void Stop(AudioHandle handle) { Stop (handle, 0.0f); }
public void Stop(AudioHandle handle, float fadeOutTime) { AudioSourceInfo sourceInfo = GetSourceInfo (handle); if (sourceInfo != null) { if (fadeOutTime > 0.0f && !_isMuted) { sourceInfo.VolumeFluctuationSpeed = -sourceInfo.Source.volume / fadeOutTime; sourceInfo.TargetVolume = 0.0f; } else { sourceInfo.Source.Stop (); } } }
public void SetVolume(AudioHandle handle, float volume) { SetVolume(handle, volume, 0.0f); }
private AudioSourceInfo GetSourceInfo(AudioHandle handle) { if (handle.Id != AudioHandle.INVALID_ID) { AudioSourceInfo sourceInfo = _sourceInfos [handle.Index]; // Verify handle integrity. if (sourceInfo.HandleId == handle.Id) { return sourceInfo; } } return null; }
public float GetPitch(AudioHandle handle) { AudioSourceInfo sourceInfo = GetSourceInfo (handle); if (sourceInfo != null) { return sourceInfo.Source.pitch; } return 1.0f; }
public void Stop(AudioHandle handle) { Stop(handle, 0.0f); }
public float GetVolume(AudioHandle handle) { AudioSourceInfo sourceInfo = GetSourceInfo (handle); if (sourceInfo != null) { return sourceInfo.Source.volume; } return 0.0f; }
public bool IsPlaying(AudioHandle handle) { AudioSourceInfo sourceInfo = GetSourceInfo (handle); if (sourceInfo != null) { return sourceInfo.Source.isPlaying; } return false; }