Пример #1
0
 /// <summary>
 /// Add and activate a <see cref="AudioListenerComponent" /> to the Audio System.
 /// After this call sounds played via <see cref="AudioEmitterSoundController" />s will be heard by this listener.
 /// </summary>
 /// <param name="listener">The listener to add to the audio system.</param>
 /// <remarks>Adding a listener already added as no effects.</remarks>
 public void AddListener(AudioListenerComponent listener)
 {
     if (!Listeners.ContainsKey(listener))
     {
         Listeners[listener] = null;
     }
 }
Пример #2
0
        /// <summary>
        /// Adds the specified entity.
        /// </summary>
        /// <param name="entity">The entity to add.</param>
        internal void InternalAddEntity(Entity entity)
        {
            // Already added?
            if (entities.ContainsKey(entity))
            {
                return;
            }

            var entityProcessors = new List <EntityProcessor>();

            entities.Add(entity, entityProcessors);

            enabledEntities.Add(entity);

            entity.AddReferenceInternal();

            entity.Tags.PropertyUpdated += EntityPropertyUpdated;

            // Check which processor want this entity
            foreach (var system in processors)
            {
                system.EntityCheck(entity, entityProcessors);
            }
        }