コード例 #1
0
        public void Stop()
        {
            m_history.Clear();
            var shot = m_gun.Shot(this, null);

            m_shot = shot;
        }
コード例 #2
0
        public void OnUpdate(float dt)
        {
            if (m_shot != null)
            {
                m_shot.OnUpdate(dt);
                if (m_shot.IsCompleted)
                {
                    m_shot?.Dispose();
                    m_shot = default;
                }
            }

            for (int i = 0; i < m_playList.Count; i++)
            {
                var p = m_playList[i];
                p.OnUpdate(dt);
            }
            for (int i = m_playList.Count - 1; i >= 0; i--)
            {
                var p = m_playList[i];
                if (!p.IsPlaying)
                {
                    p.Dispose();
                }
                if (p.IsDisposed)
                {
                    m_playList.RemoveAt(i);
                }
            }
        }
コード例 #3
0
        private void PlayCore(IMusicAmmo ammo)
        {
            var playback = m_gun.Fire(ammo);
            var shot     = m_gun.Shot(this, playback);

            m_playList.Add(playback);
            m_shot = shot;
        }