import enum entAttachmentTarget
{
	Transform,
	TargetPosition,
}

importonly abstract class IFxSystem extends IGameSystem
{
}

importonly final struct FxResource
{
	public import static function IsValid( self : FxResource ) : Bool;
}

importonly final class FxInstance extends IScriptable
{
	public import final function Kill();
	public import final function BreakLoop();
	public import final function UpdateTransform( transform : WorldTransform );
	public import final function UpdateTargetPosition( position : WorldPosition );
	public import final function SetBlackboardValue( parameterName : CName, clampedValue : Float );
	public import final function IsValid() : Bool;
	public import final function AttachToSlot( entity : weak< Entity >, targetType : entAttachmentTarget, slotName : CName, optional localTransform : WorldTransform );
	public import final function AttachToComponent( entity : weak< Entity >, targetType : entAttachmentTarget, componentName : CName, optional localTransform : WorldTransform );
}

importonly final class FxSystem extends IFxSystem
{
	public import final function SpawnEffect( resource : FxResource, transform : WorldTransform, optional ignoreTimeDilation : Bool ) : FxInstance;
	public import final function SpawnEffectOnGround( resource : FxResource, transform : WorldTransform, optional maxDistance : Float, optional minDistance : Float ) : FxInstance;
}

abstract class Example_FxSpawning extends ScriptableComponent
{
	private editable var m_effect : FxResource;
	private editable var m_effectBeam : FxResource;

	private function OnGameAttach()
	{
		var fxSystem : FxSystem;
		var beamEffectInstance : FxInstance;
		var position : WorldPosition;
		var transform : WorldTransform;
		fxSystem = GameInstance.GetFxSystem( GetOwner().GetGame() );
		WorldPosition.SetVector4( position, GetOwner().GetWorldPosition() );
		WorldTransform.SetWorldPosition( transform, position );
		fxSystem.SpawnEffect( m_effect, transform );
		beamEffectInstance = fxSystem.SpawnEffect( m_effectBeam, transform );
		beamEffectInstance.UpdateTargetPosition( position + Vector4( 0.0, 10.0, 10.0, 0.0 ) );
	}

}

