コード例 #1
0
ファイル: SoundComponent.cs プロジェクト: D-up/StarForce
 private void OnPlaySoundDependencyAsset(object sender, GameFramework.Sound.PlaySoundDependencyAssetEventArgs e)
 {
     if (m_EnablePlaySoundDependencyAssetEvent)
     {
         m_EventComponent.Fire(this, new PlaySoundDependencyAssetEventArgs(e));
     }
 }
コード例 #2
0
 private void OnPlaySoundDependencyAsset(object sender, GameFramework.Sound.PlaySoundDependencyAssetEventArgs e)
 {
     if (m_EnablePlaySoundDependencyAssetEvent)
     {
         m_EventComponent.Fire(this, ReferencePool.Acquire <PlaySoundDependencyAssetEventArgs>().Fill(e));
     }
 }
コード例 #3
0
        /// <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;
        }
コード例 #4
0
        private void LoadAssetDependencyAssetCallback(string soundAssetName, string dependencyAssetName, int loadedCount, int totalCount, object userData)
        {
            PlaySoundInfo playSoundInfo = (PlaySoundInfo)userData;

            if (playSoundInfo == null)
            {
                throw new GameFrameworkException("Play sound info is invalid.");
            }

            if (m_PlaySoundDependencyAssetEventHandler != null)
            {
                PlaySoundDependencyAssetEventArgs playSoundDependencyAssetEventArgs = PlaySoundDependencyAssetEventArgs.Create(playSoundInfo.SerialId, soundAssetName, playSoundInfo.SoundGroup.Name, playSoundInfo.PlaySoundParams, dependencyAssetName, loadedCount, totalCount, playSoundInfo.UserData);
                m_PlaySoundDependencyAssetEventHandler(this, playSoundDependencyAssetEventArgs);
                ReferencePool.Release(playSoundDependencyAssetEventArgs);
            }
        }
        /// <summary>
        /// 创建播放声音时加载依赖资源事件。
        /// </summary>
        /// <param name="e">内部事件。</param>
        /// <returns>创建的播放声音时加载依赖资源事件。</returns>
        public static PlaySoundDependencyAssetEventArgs Create(GameFramework.Sound.PlaySoundDependencyAssetEventArgs e)
        {
            PlaySoundInfo playSoundInfo = (PlaySoundInfo)e.UserData;
            PlaySoundDependencyAssetEventArgs playSoundDependencyAssetEventArgs = ReferencePool.Acquire <PlaySoundDependencyAssetEventArgs>();

            playSoundDependencyAssetEventArgs.SerialId            = e.SerialId;
            playSoundDependencyAssetEventArgs.SoundAssetName      = e.SoundAssetName;
            playSoundDependencyAssetEventArgs.SoundGroupName      = e.SoundGroupName;
            playSoundDependencyAssetEventArgs.PlaySoundParams     = e.PlaySoundParams;
            playSoundDependencyAssetEventArgs.DependencyAssetName = e.DependencyAssetName;
            playSoundDependencyAssetEventArgs.LoadedCount         = e.LoadedCount;
            playSoundDependencyAssetEventArgs.TotalCount          = e.TotalCount;
            playSoundDependencyAssetEventArgs.BindingEntity       = playSoundInfo.BindingEntity;
            playSoundDependencyAssetEventArgs.UserData            = playSoundInfo.UserData;
            return(playSoundDependencyAssetEventArgs);
        }
コード例 #6
0
 private void OnPlaySoundDependencyAsset(object sender, GameFramework.Sound.PlaySoundDependencyAssetEventArgs e)
 {
     m_EventComponent.Fire(this, PlaySoundDependencyAssetEventArgs.Create(e));
 }