Change Name Of Prefab That Initiates


I have an enemy spawn that spawns enemies every so often. They are initiated from a prefab, and when they do initiate, they are called Enemy(clone). Is it possible to give each enemy that is spawned a unique ID.

So far I have got this:

function Start ()
{ = ("EnemySpawned");

Which simply changes the name of all the Enemies that initiate, to EnemySpawned. I'm not very good to codes arrays, but I want it so it will be like:



EnemySpawned3 .... (you get the idea)

So every enemy that does spawn adds an extra value to its endding name

int prefebIndex = 0; 

function spawnEnemy()
    var Enemy:GameObject  = Instantiate(myPrefab); = "EnemySpawned" + prefebIndex;