class StopAndPlayVFXEffector extends Effector
{
	var m_vfxToStop : CName;
	var m_vfxToStart : CName;
	var m_owner : weak< GameObject >;

	protected override function Initialize( record : TweakDBID, game : GameInstance, parentRecord : TweakDBID )
	{
		m_vfxToStop = TweakDBInterface.GetCName( record + T".vfxToStop", '' );
		m_vfxToStart = TweakDBInterface.GetCName( record + T".vfxToStart", '' );
	}

	protected override function ActionOn( owner : GameObject )
	{
		m_owner = owner;
		GameObjectEffectHelper.StopEffectEvent( m_owner, m_vfxToStop );
		GameObjectEffectHelper.StartEffectEvent( m_owner, m_vfxToStart );
	}

	protected override function RepeatedAction( owner : GameObject )
	{
		m_owner = owner;
		GameObjectEffectHelper.StopEffectEvent( m_owner, m_vfxToStop );
		GameObjectEffectHelper.StartEffectEvent( m_owner, m_vfxToStart );
	}

	protected override function Uninitialize( game : GameInstance )
	{
		GameObjectEffectHelper.StopEffectEvent( m_owner, m_vfxToStart );
	}

}

class StopAndPlaySFXEffector extends Effector
{
	var m_sfxToStop : CName;
	var m_sfxToStart : CName;
	var m_owner : weak< GameObject >;

	protected override function Initialize( record : TweakDBID, game : GameInstance, parentRecord : TweakDBID )
	{
		m_sfxToStop = TweakDBInterface.GetCName( record + T".sfxToStop", '' );
		m_sfxToStart = TweakDBInterface.GetCName( record + T".sfxToStart", '' );
	}

	protected override function RepeatedAction( owner : GameObject )
	{
		m_owner = owner;
		GameObject.StopSound( m_owner, m_sfxToStop, 'Scripts:StopAndPlaySFXEffector:ActionOn' );
		GameObject.PlaySound( m_owner, m_sfxToStart, 'Scripts:StopAndPlaySFXEffector:ActionOn' );
	}

	protected override function ActionOn( owner : GameObject )
	{
		m_owner = owner;
		GameObject.StopSound( m_owner, m_sfxToStop, 'Scripts:StopAndPlaySFXEffector:ActionOn' );
		GameObject.PlaySound( m_owner, m_sfxToStart, 'Scripts:StopAndPlaySFXEffector:ActionOn' );
	}

	protected override function Uninitialize( game : GameInstance )
	{
		GameObject.StopSound( m_owner, m_sfxToStart, 'Scripts:StopAndPlaySFXEffector:Uninitialize' );
	}

}

