/// <summary> /// Internal method for creating a new emitter from a factory. /// </summary> /// <remarks> /// Used internally by the engine to create new ParticleEmitter instances from named /// factories. Applications should use the ParticleSystem.AddEmitter method instead, /// which calls this method to create an instance. /// </remarks> /// <param name="emitterType">string name of the emitter type to be created. A factory of this type must have been registered.</param> internal ParticleEmitter CreateEmitter(string emitterType) { ParticleEmitterFactory factory = emitterFactoryList[emitterType]; if (factory == null) { throw new AxiomException("Cannot find requested emitter '{0}'.", emitterType); } return(factory.Create()); }
/// <summary> /// Adds a new 'factory' object for emitters to the list of available emitter types. /// </summary> /// <remarks> /// This method allows plugins etc to add new particle emitter types. Particle emitters /// are sources of particles, and generate new particles with their start positions, colors and /// momentums appropriately. Plugins would create new subclasses of ParticleEmitter which /// emit particles a certain way, and register a subclass of ParticleEmitterFactory to create them (since multiple /// emitters can be created for different particle systems). /// <p/> /// All particle emitter factories have an assigned name which is used to identify the emitter /// type. This must be unique. /// </remarks> /// <param name="factory"></param> public void AddEmitterFactory(ParticleEmitterFactory factory) { emitterFactoryList.Add(factory.Name, factory); log.InfoFormat("Particle Emitter type '{0}' registered.", factory.Name); }
/// <summary> /// Adds a new 'factory' object for emitters to the list of available emitter types. /// </summary> /// <remarks> /// This method allows plugins etc to add new particle emitter types. Particle emitters /// are sources of particles, and generate new particles with their start positions, colors and /// momentums appropriately. Plugins would create new subclasses of ParticleEmitter which /// emit particles a certain way, and register a subclass of ParticleEmitterFactory to create them (since multiple /// emitters can be created for different particle systems). /// <p/> /// All particle emitter factories have an assigned name which is used to identify the emitter /// type. This must be unique. /// </remarks> /// <param name="factory"></param> public void AddEmitterFactory(ParticleEmitterFactory factory) { this.emitterFactoryList.Add(factory.Name.ToLower().GetHashCode(), factory); LogManager.Instance.Write("Particle Emitter type '{0}' registered.", factory.Name); }
/// <summary> /// Adds a new 'factory' object for emitters to the list of available emitter types. /// </summary> /// <remarks> /// This method allows plugins etc to add new particle emitter types. Particle emitters /// are sources of particles, and generate new particles with their start positions, colors and /// momentums appropriately. Plugins would create new subclasses of ParticleEmitter which /// emit particles a certain way, and register a subclass of ParticleEmitterFactory to create them (since multiple /// emitters can be created for different particle systems). /// <p/> /// All particle emitter factories have an assigned name which is used to identify the emitter /// type. This must be unique. /// </remarks> /// <param name="factory"></param> public void AddEmitterFactory(ParticleEmitterFactory factory) { emitterFactoryList.Add(factory.Name, factory); log.InfoFormat("Particle Emitter type '{0}' registered.", factory.Name); }
/// <summary> /// Adds a new 'factory' object for emitters to the list of available emitter types. /// </summary> /// <remarks> /// This method allows plugins etc to add new particle emitter types. Particle emitters /// are sources of particles, and generate new particles with their start positions, colors and /// momentums appropriately. Plugins would create new subclasses of ParticleEmitter which /// emit particles a certain way, and register a subclass of ParticleEmitterFactory to create them (since multiple /// emitters can be created for different particle systems). /// <p/> /// All particle emitter factories have an assigned name which is used to identify the emitter /// type. This must be unique. /// </remarks> /// <param name="factory"></param> public void AddEmitterFactory( ParticleEmitterFactory factory ) { this.emitterFactoryList.Add( factory.Name.ToLower().GetHashCode(), factory ); LogManager.Instance.Write( "Particle Emitter type '{0}' registered.", factory.Name ); }