/// <summary> /// Internal method for creating a new affector from a factory. /// </summary> /// <remarks> /// Used internally by the engine to create new ParticleAffector instances from named /// factories. Applications should use the ParticleSystem.AddAffector method instead, /// which calls this method to create an instance. /// </remarks> /// <param name="emitterType">string name of the affector type to be created. A factory of this type must have been registered.</param> internal ParticleAffector CreateAffector(string affectorType) { ParticleAffectorFactory factory = (ParticleAffectorFactory)affectorFactoryList[affectorType]; if (factory == null) { throw new AxiomException("Cannot find requested affector '{0}'.", affectorType); } return(factory.Create()); }
/// <summary> /// Adds a new 'factory' object for affectors to the list of available affector types. /// </summary> /// <remarks> /// This method allows plugins etc to add new particle affector types. Particle /// affectors modify the particles in a system a certain way such as affecting their direction /// or changing their color, lifespan etc. Plugins would /// create new subclasses of ParticleAffector which affect particles a certain way, and register /// a subclass of ParticleAffectorFactory to create them. /// <p/> /// All particle affector factories have an assigned name which is used to identify the affector /// type. This must be unique. /// </remarks> /// <param name="factory"></param> public void AddAffectorFactory(ParticleAffectorFactory factory) { affectorFactoryList.Add(factory.Name, factory); log.InfoFormat("Particle Affector type '{0}' registered.", factory.Name); }
/// <summary> /// Adds a new 'factory' object for affectors to the list of available affector types. /// </summary> /// <remarks> /// This method allows plugins etc to add new particle affector types. Particle /// affectors modify the particles in a system a certain way such as affecting their direction /// or changing their color, lifespan etc. Plugins would /// create new subclasses of ParticleAffector which affect particles a certain way, and register /// a subclass of ParticleAffectorFactory to create them. /// <p/> /// All particle affector factories have an assigned name which is used to identify the affector /// type. This must be unique. /// </remarks> /// <param name="factory"></param> public void AddAffectorFactory(ParticleAffectorFactory factory) { this.affectorFactoryList.Add(factory.Name.ToLower().GetHashCode(), factory); LogManager.Instance.Write("Particle Affector type '{0}' registered.", factory.Name); }
/// <summary> /// Adds a new 'factory' object for affectors to the list of available affector types. /// </summary> /// <remarks> /// This method allows plugins etc to add new particle affector types. Particle /// affectors modify the particles in a system a certain way such as affecting their direction /// or changing their color, lifespan etc. Plugins would /// create new subclasses of ParticleAffector which affect particles a certain way, and register /// a subclass of ParticleAffectorFactory to create them. /// <p/> /// All particle affector factories have an assigned name which is used to identify the affector /// type. This must be unique. /// </remarks> /// <param name="factory"></param> public void AddAffectorFactory(ParticleAffectorFactory factory) { affectorFactoryList.Add(factory.Name, factory); log.InfoFormat("Particle Affector type '{0}' registered.", factory.Name); }
/// <summary> /// Adds a new 'factory' object for affectors to the list of available affector types. /// </summary> /// <remarks> /// This method allows plugins etc to add new particle affector types. Particle /// affectors modify the particles in a system a certain way such as affecting their direction /// or changing their color, lifespan etc. Plugins would /// create new subclasses of ParticleAffector which affect particles a certain way, and register /// a subclass of ParticleAffectorFactory to create them. /// <p/> /// All particle affector factories have an assigned name which is used to identify the affector /// type. This must be unique. /// </remarks> /// <param name="factory"></param> public void AddAffectorFactory( ParticleAffectorFactory factory ) { this.affectorFactoryList.Add( factory.Name.ToLower().GetHashCode(), factory ); LogManager.Instance.Write( "Particle Affector type '{0}' registered.", factory.Name ); }