//creates creep public void createCreep(Vector2 gridPos, creepType type) { GameObject newCreepType = typeToCreep(type); GameObject newCreep = (GameObject)Instantiate(newCreepType, new Vector3(gridPos.x, 0.6f, gridPos.y), Quaternion.identity); //newCreep.GetComponent("Turret").gm = this.GetComponent("Game Manager"); newCreep.tag = "Creep"; //creeps.Add(newCreep); }
GameObject typeToCreep(creepType type) { switch ((int)type) { case 0: return(basicCreep); case 1: return(quickCreep); case 2: return(quickStatusCreep); case 3: return(strongCreep); case 4: return(strongStatusCreep); default: break; } return(basicCreep); }