Esempio n. 1
0
    /**
     * 무기와 갑옷을 장착했냐, 해제했냐에 따라서 선택 상자에 뜨는 텍스트를 다르게 해주는 함수
     * 예를 들어 플레이어가 장착하고 있다면 선택 상자에 "해재하겠습니까?"라는 텍스트가 떠야 한다.
     */
    private void ChangeButtonText(WeaponArmorDialogBox W)
    {
        int i;

        UnityEngine.UI.Button[] buttons = W.GetComponentsInChildren <UnityEngine.UI.Button>();
        for (i = 0; i < buttons.Length; i++)
        {
            if (buttons[i].name == "EquipandUnequip")
            {
                break;
            }
        }
        if (player.weaponindex == index || player.armorindex == index)
        {
            buttons[i].GetComponentInChildren <UnityEngine.UI.Text>().text = "해제하기";
        }
        else
        {
            buttons[i].GetComponentInChildren <UnityEngine.UI.Text>().text = "장착하기";
        }
    }