// creates the enemy specified at 'i' (0-left, 1-mid, 2-right) by the 'scene' private void createEnemy(int i, string name) { ++field.enemy_count; Enemy enemy = Instantiate(enemy_prefab, transform).GetComponent <Enemy>();; enemy.transform.localScale = new Vector3(1, 1, 1); Vector3 enemy_pos = new Vector3(i * BattleUI.enemy_spacing, BattleUI.enemy_y_offset, 0); enemy.transform.localPosition = enemy_pos; enemy.field = field; enemy.castManager = castManager; enemy.initialize(enemyData.getData(name)); //sets enemy stats (AND INITITIALIZES ATTACKING AND AI) enemy.Position = i; //Log enemy position in field enemy.bars = uiManager.charge_bars; //Give enemy access to charge_bars Vector3 bar_pos = enemy.transform.position + new Vector3(0, -1.75f, 0); uiManager.charge_bars.makeChargeMeter(i, bar_pos); uiManager.stagger_bars.makeStaggerMeter(i, bar_pos); uiManager.health_bars.makeHealthMeter(i, bar_pos); field.enemy_arr[i] = enemy; enemy.enemy_animator.Play("enemy_spawn_in"); uiManager.updateUI(); }