Пример #1
0
 private void HandleMessages()
 {
     while (MessageInterface.HasMessageInQueue)
     {
         HandleMessage(MessageInterface.PopFromQueue());
     }
 }
Пример #2
0
        protected virtual void Update()
        {
            while (MessageInterface.HasMessageInQueue)
            {
                HandleMessage(MessageInterface.PopFromQueue());
            }

            UpdateSubtitles();
        }
Пример #3
0
    void HandleMessages()
    {
        if (MessageInterface.Valid && MessageInterface.HasMessageInQueue)
        {
            while (MessageInterface.HasMessageInQueue)
            {
                QdmsMessage msg = MessageInterface.PopFromQueue();

                if (msg.GetType() == typeof(RpgChangeWeaponMessage))
                {
                    DoEquipmentThing();
                }
            }
        }
    }
Пример #4
0
        void Update()
        {
            //message bus integration
            while (MessageInterface.HasMessageInQueue)
            {
                HandleMessage(MessageInterface.PopFromQueue());
            }

            //run cleanup periodically
            TimeElapsed += Time.deltaTime;
            if (TimeElapsed >= CleanupInterval)
            {
                for (int i = PlayingSounds.Count - 1; i >= 0; i--)
                {
                    var s = PlayingSounds[i];
                    if (s.Source == null || !s.Source.isPlaying)
                    {
                        Destroy(s.Source.gameObject);
                        PlayingSounds.RemoveAt(i);
                    }
                }

                TimeElapsed = 0;
            }

            //report time if applicable
            if (MusicEnabled && CurrentUserMusicComponent != null && CurrentMusicSlot == MusicSlot.User && MusicPlayers[MusicSlot.User].isPlaying && MusicPlayers[MusicSlot.User].clip != null)
            {
                CurrentUserMusicComponent.ReportTime(MusicPlayers[MusicSlot.User].time);
            }

            //handle track ended
            if (MusicEnabled && CurrentUserMusicComponent != null && CurrentMusicSlot == MusicSlot.User &&
                !MusicPlayers[MusicSlot.User].isPlaying && MusicPlayers[MusicSlot.User].clip != null && MusicPlayers[MusicSlot.User].timeSamples == MusicPlayers[MusicSlot.User].clip.samples)
            {
                CurrentUserMusicComponent.SignalTrackEnded();
            }
        }