Пример #1
0
        void OnEnable()
        {
            m_TrafficFieldSystem = World.Active.GetOrCreateManager <TrafficAudioFieldSystem>();
            m_FlyBySystem        = World.Active.GetOrCreateManager <FlyBySystem>();

            m_FlyBySounds = m_FlyBySystem.CreateCollection();

            foreach (var clip in audioClips)
            {
                m_TrafficFieldSystem.AddDistributedSamplePlayback(clip);
            }

            foreach (var clip in vehicleLowIntensities)
            {
                if (clip != null)
                {
                    m_FlyBySystem.AddLowFlyBySound(m_FlyBySounds, clip);
                }
            }

            foreach (var clip in vehicleHighIntensities)
            {
                if (clip != null)
                {
                    m_FlyBySystem.AddHighFlyBySound(m_FlyBySounds, clip);
                }
            }

            m_TrafficFieldSystem.SetFlyBySoundGroup(m_FlyBySounds);
        }
Пример #2
0
        public void AddLowFlyBySound(SoundCollection collection, AudioClip clip)
        {
            var sample = EntityManager.CreateEntity();

            AddClip(clip);
            EntityManager.AddComponentData(sample, new SharedAudioClip {
                ClipInstanceID = clip.GetInstanceID()
            });
            m_SampleFlyByEntities.Add(new SampleInfo {
                Length = clip.length, PlayerEntity = sample, Intensity = 0
            });
            m_SampleLowFreeList.Add(m_SampleFlyByEntities.Length - 1);
        }
Пример #3
0
 public void SetFlyBySoundGroup(SoundCollection group)
 {
     m_FlyBySoundCollection = group;
 }