/// <summary> /// 填充播放声音成功事件。 /// </summary> /// <param name="e">内部事件。</param> /// <returns>播放声音成功事件。</returns> public PlaySoundSuccessEventArgs Fill(Ash.Core.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; return(this); }
/// <summary> /// 填充播放声音更新事件。 /// </summary> /// <param name="e">内部事件。</param> /// <returns>播放声音更新事件。</returns> public PlaySoundUpdateEventArgs Fill(Ash.Core.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; return(this); }
/// <summary> /// 填充播放声音失败事件。 /// </summary> /// <param name="e">内部事件。</param> /// <returns>播放声音失败事件。</returns> public PlaySoundFailureEventArgs Fill(Ash.Core.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; return(this); }
/// <summary> /// 填充播放声音时加载依赖资源事件。 /// </summary> /// <param name="e">内部事件。</param> /// <returns>播放声音时加载依赖资源事件。</returns> public PlaySoundDependencyAssetEventArgs Fill(Ash.Core.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; return(this); }
private void OnPlaySoundSuccess(object sender, Ash.Core.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, ReferencePool.Acquire <PlaySoundSuccessEventArgs>().Fill(e)); } }