Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Gameplay.VehicleEffectObserver


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
class VehicleEffectObserver extends Core.DeleteableObject implements IEffectObserver
	native;

var Emitter			emitter;
var SoundInstance	sound;		// rowan: we need to cleanup our sound instance properly
var float originalParticlesPerSecond;

function cleanup()
{
	// remove us from sound observer, or else it will crash when de-reffing us
	if (sound != None)
		sound.SetObserver(None);
}

function OnEffectStarted(Actor inStartedEffect)
{
	// if already bound to sound, unbind (or else we might fail to unbind properly in Cleanup)
	if (sound != None)
		sound.SetObserver(None);

	emitter = Emitter(inStartedEffect);
	sound = SoundInstance(inStartedEffect);
	if (emitter != None)
		originalParticlesPerSecond = emitter.emitters[0].ParticlesPerSecond;
}

function OnEffectStopped(Actor inStoppedEffect, bool Completed)
{
	sound = None;
}

function OnEffectInitialized(Actor inInitializedEffect)
{
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: ne 5.9.2004 15:53:28.000 - Creation time: st 23.5.2018 00:10:50.415 - Created with UnCodeX