public void Stop() { m_history.Clear(); var shot = m_gun.Shot(this, null); m_shot = shot; }
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); } } }
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; }