#pragma strict

//var speed = 2.0f;

var enemySpawnerTarget : GameObject;
private var enemySpawner : EnemySpawner;

var navicellaRed : Material;
var navicellaYellow : Material;
var navicellaGreen : Material;
var navicellaBlue : Material;

function Start () {
	
	enemySpawner = enemySpawnerTarget.GetComponent(EnemySpawner);
}

function Update () {

	renderer.material.mainTextureOffset.y += 0.5f;

	renderer.material = GetMaterial(enemySpawner.color);
}

function GetMaterial(c) : Material {

	switch(c) {
		case 0:
			return navicellaRed;
		case 1:
			return navicellaYellow;
		case 2:
			return navicellaGreen;
		case 3:
			return navicellaBlue;

	}

}