//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 loyalsoft. All rights reserved.
// Homepage: http://www.game7000.com/
// Feedback: http://www.game7000.com/
//------------------------------------------------------------
namespace GameFramework.Sound
{
///
/// 播放声音时加载依赖资源事件。
///
public sealed class PlaySoundDependencyAssetEventArgs : GameFrameworkEventArgs
{
///
/// 初始化播放声音时加载依赖资源事件的新实例。
///
public PlaySoundDependencyAssetEventArgs()
{
SerialId = 0;
SoundAssetName = null;
SoundGroupName = null;
PlaySoundParams = null;
DependencyAssetName = null;
LoadedCount = 0;
TotalCount = 0;
UserData = null;
}
///
/// 获取声音的序列编号。
///
public int SerialId
{
get;
private set;
}
///
/// 获取声音资源名称。
///
public string SoundAssetName
{
get;
private set;
}
///
/// 获取声音组名称。
///
public string SoundGroupName
{
get;
private set;
}
///
/// 获取播放声音参数。
///
public PlaySoundParams PlaySoundParams
{
get;
private set;
}
///
/// 获取被加载的依赖资源名称。
///
public string DependencyAssetName
{
get;
private set;
}
///
/// 获取当前已加载依赖资源数量。
///
public int LoadedCount
{
get;
private set;
}
///
/// 获取总共加载依赖资源数量。
///
public int TotalCount
{
get;
private set;
}
///
/// 获取用户自定义数据。
///
public object UserData
{
get;
private set;
}
///
/// 创建播放声音时加载依赖资源事件。
///
/// 声音的序列编号。
/// 声音资源名称。
/// 声音组名称。
/// 播放声音参数。
/// 被加载的依赖资源名称。
/// 当前已加载依赖资源数量。
/// 总共加载依赖资源数量。
/// 用户自定义数据。
/// 创建的播放声音时加载依赖资源事件。
public static PlaySoundDependencyAssetEventArgs Create(int serialId, string soundAssetName, string soundGroupName, PlaySoundParams playSoundParams, string dependencyAssetName, int loadedCount, int totalCount, object userData)
{
PlaySoundDependencyAssetEventArgs playSoundDependencyAssetEventArgs = ReferencePool.Acquire();
playSoundDependencyAssetEventArgs.SerialId = serialId;
playSoundDependencyAssetEventArgs.SoundAssetName = soundAssetName;
playSoundDependencyAssetEventArgs.SoundGroupName = soundGroupName;
playSoundDependencyAssetEventArgs.PlaySoundParams = playSoundParams;
playSoundDependencyAssetEventArgs.DependencyAssetName = dependencyAssetName;
playSoundDependencyAssetEventArgs.LoadedCount = loadedCount;
playSoundDependencyAssetEventArgs.TotalCount = totalCount;
playSoundDependencyAssetEventArgs.UserData = userData;
return playSoundDependencyAssetEventArgs;
}
///
/// 清理播放声音时加载依赖资源事件。
///
public override void Clear()
{
SerialId = 0;
SoundAssetName = null;
SoundGroupName = null;
PlaySoundParams = null;
DependencyAssetName = null;
LoadedCount = 0;
TotalCount = 0;
UserData = null;
}
}
}