예제 #1
0
    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);
    }
예제 #2
0
    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);
    }