public void SelectEnemy(EnemySelectButton esb) { if (currentManual != 1) { return; } buttonList_enemy[selected_enemy].SetSelected(false); esb.SetSelected(true); selected_enemy = esb.index; ShowEnemyInfo(esb.enemyID); }
public GameObject AddEnemyButton(int enemyID) { GameObject button = Instantiate(buttonPrefab_enemy, layout_enemy); EnemySelectButton tsb = button.GetComponent <EnemySelectButton>(); tsb.SetID(enemyID); tsb.button.onClick.AddListener( delegate { SelectEnemy(tsb); } ); tsb.index = buttonList_enemy.Count; tsb.SetSelected(selected_enemy == tsb.index); buttonList_enemy.Add(tsb); return(button); }