/// <summary> /// 初始化播放声音成功事件的新实例。 /// </summary> /// <param name="e">内部事件。</param> public PlaySoundSuccessEventArgs(GameFramework.Sound.PlaySoundSuccessEventArgs e) { PlaySoundInfo playSoundInfo = (PlaySoundInfo)e.UserData; SerialId = e.SerialId; SoundAssetName = e.SoundAssetName; SoundAgent = e.SoundAgent; Duration = e.Duration; BindingEntity = playSoundInfo.BindingEntity; UserData = playSoundInfo.UserData; }
/// <summary> /// 初始化播放声音更新事件的新实例。 /// </summary> /// <param name="e">内部事件。</param> public PlaySoundUpdateEventArgs(GameFramework.Sound.PlaySoundUpdateEventArgs e) { PlaySoundInfo playSoundInfo = (PlaySoundInfo)e.UserData; SerialId = e.SerialId; SoundAssetName = e.SoundAssetName; SoundGroupName = e.SoundGroupName; PlaySoundParams = e.PlaySoundParams; Progress = e.Progress; BindingEntity = playSoundInfo.BindingEntity; UserData = playSoundInfo.UserData; }
/// <summary> /// 初始化播放声音失败事件的新实例。 /// </summary> /// <param name="e">内部事件。</param> public PlaySoundFailureEventArgs(GameFramework.Sound.PlaySoundFailureEventArgs e) { PlaySoundInfo playSoundInfo = (PlaySoundInfo)e.UserData; SerialId = e.SerialId; SoundAssetName = e.SoundAssetName; SoundGroupName = e.SoundGroupName; PlaySoundParams = e.PlaySoundParams; BindingEntity = playSoundInfo.BindingEntity; ErrorCode = e.ErrorCode; ErrorMessage = e.ErrorMessage; UserData = playSoundInfo.UserData; }
/// <summary> /// 初始化播放声音时加载依赖资源事件的新实例。 /// </summary> /// <param name="e">内部事件。</param> public PlaySoundDependencyAssetEventArgs(GameFramework.Sound.PlaySoundDependencyAssetEventArgs e) { PlaySoundInfo playSoundInfo = (PlaySoundInfo)e.UserData; SerialId = e.SerialId; SoundAssetName = e.SoundAssetName; SoundGroupName = e.SoundGroupName; PlaySoundParams = e.PlaySoundParams; DependencyAssetName = e.DependencyAssetName; LoadedCount = e.LoadedCount; TotalCount = e.TotalCount; BindingEntity = playSoundInfo.BindingEntity; UserData = playSoundInfo.UserData; }
private void OnPlaySoundSuccess(object sender, GameFramework.Sound.PlaySoundSuccessEventArgs e) { PlaySoundInfo playSoundInfo = (PlaySoundInfo)e.UserData; if (playSoundInfo != null) { SoundAgentHelperBase soundAgentHelper = (SoundAgentHelperBase)e.SoundAgent.Helper; if (playSoundInfo.BindingEntity != null) { soundAgentHelper.SetBindingEntity(playSoundInfo.BindingEntity); } else { soundAgentHelper.SetWorldPosition(playSoundInfo.WorldPosition); } } if (m_EnablePlaySoundSuccessEvent) { m_EventComponent.Fire(this, new PlaySoundSuccessEventArgs(e)); } }