/// <summary> /// This function tells the FX manager to recycle a non-active (Dead) FX object, /// depending on its type /// </summary> /// <param name="type">The type of the FX object to recycle</param> /// <param name="position">The location of the FX object</param> /// <param name="direction">The direction the FX object should face (1 = same as the animation, -1 = mirror along the x axis of the animation)</param> /// <param name="value">The value to assign to the FX object</param> public void Activate(ROTD_FX.FX_TYPE type, Vector3 position, int direction, string value) { // check each FX object in the internal list foreach (ROTD_FX fx in _fxList) { // if the FX object is dead and is of the type we are looking for then recycle it if (fx.State == ROTD_FX.STATE.Dead && fx.fxType == type) { // reset the FX object, bringing it back to life fx.Reset(position, direction, value); break; } } }
/// <summary> /// This function is called from the FX object, notifying the manager that /// the object needs to be deactivated. /// Note that this does not destroy the object, merely turns it "off" for /// reuse later. /// </summary> /// <param name="fx">The FX object to deactivate</param> public void KillFX(ROTD_FX fx) { // set the state of the FX object to Dead fx.State = ROTD_FX.STATE.Dead; }