How to make the number of enemy to multiply as time goes by?
Assuming your function has been created to spawn your enemies already.
Create a variable, for example, numEnemies = 1;
Then in your function for where you are creating the enemies, at the end of that function just add more to that variable, for example numEnemies += 3; You will then have 4 enemies spawning for the next time it runs threw that function. This also depends how you are creating your enemies.
If you are instantiating them, the best idea would be to create a for loop.
var TimerMax : float = 10.0; // Every 10 Seconds
var TimerIndex : float = 0; // Current Time
function MakeEnemy ( enemyCount : int )
{
for ( var i = 0; i < enemyCount ; i ++ )
{
Instantiate ( EnemyObject , transform.position, transform.rotation ) ; // Instantite X times
}
}
function Update ( )
{
if ( TimerIndex >= TimerMax )
{
TimerIndex = 0;
Instantiate ( object, transform.position, transform.rotation ) ;
//MakeEnemy ( 3 ) ; // Create 3 enemies
} // Instantiate every 10 seconds
else{
TimerIndex += 1 * Time.deltaTime ;
}
}