#pragma strict

var Prefab : GameObject;
var Timeout : float = 0;
var Repeat : float = 0;
var Enabled : boolean = true;

function Start()
{
}

function Update()
{
	if( Enabled )
	{
		if( Timeout > 0 )
			Timeout -= Time.deltaTime;
		else
		{
			Instantiate( Prefab, transform.position, transform.rotation );
			if( Repeat > 0 )
				Timeout = Repeat;
			else
				Enabled = false;
		}
	}
}

function Action()
{
	Enabled = true;
}
