## XIDCine
Class TrigerredEmitter

source: C:\XIII\XIDCine\Classes\TrigerredEmitter.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Emitter
             |
             +--XIDCine.TrigerredEmitter

Direct Known Subclasses:PloufEmitter, TrigerredExplosionEmitter

class TrigerredEmitter
extends Engine.Emitter

    //-----------------------------------------------------------
    // TrigerredEmitter
    // Created by iKi
    // Last Modification by iKi
    //-----------------------------------------------------------

Variables
`float` | `EmitTime`
`bool` | `ForceParticlesSpawn`
`bool` | `bInitiallyOn`
`bool` | `bTriggeredOnceOnly`

Source Code

    00001	//-----------------------------------------------------------
    00002	// TrigerredEmitter
    00003	// Created by iKi
    00004	// Last Modification by iKi
    00005	//-----------------------------------------------------------
    00006	class TrigerredEmitter extends Emitter;
    00007
    00008	VAR() bool ForceParticlesSpawn;
    00009	VAR() bool bInitiallyOn;
    00010	VAR() bool bTriggeredOnceOnly;
    00011	VAR() float EmitTime;
    00012
    00013	EVENT PostBeginPlay( )
    00014	{
    00015		LOCAL int i;
    00016
    00017		for (i=0;i<Emitters.Length;++i)
    00018			Emitters[i].Disabled=!bInitiallyOn;
    00019	}
    00020	/*
    00021	EVENT Tick (float dt)
    00022	{
    00023		DebugLog("============================"@Rotation);
    00024	}
    00025	*/
    00026	STATE() TriggerToggle
    00027	{
    00028		EVENT Trigger( actor Other, pawn EventInstigator )
    00029		{
    00030			LOCAL int i;
    00031
    00032			if (bTriggeredOnceOnly)
    00033				Disable('Trigger');
    00034
    00035			for (i=0;i<Emitters.Length;++i)
    00036				Emitters[i].Disabled=!Emitters[i].Disabled;
    00037		}
    00038	}
    00039
    00040	STATE() TriggerControl
    00041	{
    00042		EVENT Trigger( actor Other, pawn EventInstigator )
    00043		{
    00044			LOCAL int i;
    00045
    00046			if (bTriggeredOnceOnly)
    00047				Disable('Trigger');
    00048
    00049			for (i=0;i<Emitters.Length;++i)
    00050				Emitters[i].Disabled=bInitiallyOn;
    00051		}
    00052		EVENT Untrigger( actor Other, pawn EventInstigator )
    00053		{
    00054			LOCAL int i;
    00055
    00056			if (bTriggeredOnceOnly)
    00057				Disable('Untrigger');
    00058
    00059			for (i=0;i<Emitters.Length;++i)
    00060				Emitters[i].Disabled=!bInitiallyOn;
    00061		}
    00062	}
    00063
    00064	STATE() TriggerEmit
    00065	{
    00066		EVENT Trigger( actor Other, pawn EventInstigator )
    00067		{
    00068			LOCAL int i;
    00069
    00070			if (bTriggeredOnceOnly)
    00071				Disable('Trigger');
    00072
    00073			for (i=0;i<Emitters.Length;++i)
    00074			{
    00075				Emitters[i].Disabled=!Emitters[i].Disabled;
    00076				if (ForceParticlesSpawn)
    00077					Emitters[i].SpawnParticle(Emitters[i].MaxParticles);
    00078			}
    00079		}
    00080	}
    00081
    00082	STATE() TriggerPound
    00083	{
    00084		EVENT Trigger( actor Other, pawn EventInstigator )
    00085		{
    00086			LOCAL int i;
    00087
    00088			if (bTriggeredOnceOnly)
    00089				Disable('Trigger');
    00090
    00091			for (i=0;i<Emitters.Length;++i)
    00092			{
    00093				Emitters[i].Disabled=!Emitters[i].Disabled;
    00094				if (ForceParticlesSpawn)
    00095					Emitters[i].SpawnParticle(Emitters[i].MaxParticles);
    00096			}
    00097			SetTimer(EmitTime,false);
    00098		}
    00099
    00100		EVENT Timer( )
    00101		{
    00102			LOCAL int i;
    00103
    00104			if (bTriggeredOnceOnly)
    00105				Disable('Untrigger');
    00106
    00107			for (i=0;i<Emitters.Length;++i)
    00108				Emitters[i].Disabled=!bInitiallyOn;
    00109		}
    00110	}
    00111
    00112
    00113
    00114
    00115	defaultproperties
    00116	{
    00117	     EmitTime=1.000000
    00118	     InitialState="TriggerEmit"
    00119	}

End Source Code