class PlayBreathingAnimationEffector extends Effector
{
	var m_animFeature : AnimFeature_CameraBreathing;
	var m_animFeatureName : CName;
	var m_owner : weak< GameObject >;

	protected export override function Initialize( record : TweakDBID, game : GameInstance, parentRecord : TweakDBID )
	{
		var blendInDuration : Float;
		var blendOutDuration : Float;
		m_animFeatureName = TweakDBInterface.GetCName( record + T".animFeatureName", '' );
		if( !( IsNameValid( m_animFeatureName ) ) )
		{
			return;
		}
		m_animFeature = new AnimFeature_CameraBreathing;
		m_animFeature.amplitudeWeight = TweakDBInterface.GetFloat( record + T".amplitudeWeight", 0.0 );
		blendInDuration = TweakDBInterface.GetFloat( record + T".blendInDuration", 0.0 );
		blendOutDuration = TweakDBInterface.GetFloat( record + T".blendOutDuration", 0.0 );
		m_animFeature.dampIncreaseSpeed = ( ( blendInDuration > 0.0 ) ? ( m_animFeature.amplitudeWeight / blendInDuration ) : ( 9999.0 ) );
		m_animFeature.dampDecreaseSpeed = ( ( blendOutDuration > 0.0 ) ? ( m_animFeature.amplitudeWeight / blendOutDuration ) : ( 9999.0 ) );
	}

	protected export override function ActionOn( owner : GameObject )
	{
		m_owner = owner;
		if( m_animFeature && m_owner )
		{
			AnimationControllerComponent.ApplyFeature( m_owner, m_animFeatureName, m_animFeature );
		}
	}

	protected override function ActionOff( owner : GameObject )
	{
		if( m_animFeature && m_owner )
		{
			m_animFeature.amplitudeWeight = 0.0;
			AnimationControllerComponent.ApplyFeature( m_owner, m_animFeatureName, m_animFeature );
		}
	}

	protected export override function Uninitialize( game : GameInstance )
	{
		if( m_animFeature && m_owner )
		{
			m_animFeature.amplitudeWeight = 0.0;
			AnimationControllerComponent.ApplyFeature( m_owner, m_animFeatureName, m_animFeature );
		}
	}

}

