예제 #1
0
    // 업적 성공 반영
    public void Success()
    {
        mission.success = !mission.success;
        clear.SetTrigger("Clear");

        // 유저 경험치 상승
        float full    = dataManager.userInfo.level * 20 + 100;
        float current = dataManager.userInfo.value;

        dataManager.userInfo.value = (current * full + mission.price) / full;

        // 레벨업을 했을 경우
        if (dataManager.userInfo.value >= 1)
        {
            dataManager.userInfo.level++;
            dataManager.userInfo.value -= 1;
        }

        // UI 스텟에 반영
        uiManager.levelTxt.text       = "LV " + dataManager.userInfo.level;
        uiManager.valueImg.fillAmount = dataManager.userInfo.value;
        uiManager.valueTxt.text       = (int)(dataManager.userInfo.value * 100) + "%";

        dataManager.SaveInformation();
        dataManager.SaveMission();
    }
예제 #2
0
 public void UpdateInformation()
 {
     uiManager.rankTxt.text    = "계급 " + rankDropdown.captionText.text;
     uiManager.nameTxt.text    = "이름 " + nameField.text;
     dataManager.userInfo.rank = rankDropdown.captionText.text;
     dataManager.userInfo.name = nameField.text;
     dataManager.SaveInformation();
 }