TIL(2024,07,24)최종 프로젝트 1차구현 하나씩 만들기

김보근·2024년 7월 24일

Unity

목록 보기
49/113

TIL (Today I Learned)

작업 내용
오늘은 Unity 게임 개발 프로젝트에서 스킬과 아티팩트의 팝업 UI를 개선하는 작업을 진행했습니다. 특히, 스킬과 아티팩트의 현재 레벨을 표시하고, 다음 레벨의 능력을 명확하게 보여주는 기능을 추가했습니다.

주요 변경 사항 및 추가 사항
스킬 및 아티팩트의 현재 레벨 표시

팝업 UI에 현재 스킬 및 아티팩트의 레벨을 표시하도록 수정했습니다.

다음 레벨의 능력 설명 표시
현재 레벨과 다음 레벨의 능력 설명을 명확하게 구분하여 표시하도록 수정했습니다.

상세 작업 내역

LifeBoostSkill 클래스 수정

public override string GetNextAbilityDescription()
{
    BigInteger nextSkillMultiplier = currentLevel == 0 ? 60 : 60 + currentLevel * 60;
    return $"즉시 획득 생명력: {skillMultiplier} 배 -> {nextSkillMultiplier} 배";
}

RootBoostSkill 클래스 수정

public override string GetNextAbilityDescription()
{
    BigInteger nextBoostMultiplier = currentLevel == 0
        ? baseBoostMultiplier
        : baseBoostMultiplier + currentLevel * 100;
    return $"부스트 배수: {boostMultiplier} -> {nextBoostMultiplier}, 부스트 지속 시간: {boostDuration / 60}분";
}

SkillPopUp 클래스 수정

팝업 UI 수정
NowAbilityText를 현재 레벨을 표시하는 용도로 변경하고, 현재 레벨을 표시하도록 SetSkillTexts 및 SetArtifactTexts 메서드를 수정했습니다.

public void SetArtifactTexts(string nextAbilityText)
{
    SkillNameText.text = correspondingArtifact.artifactName;
    NowAbilityText.text = $"현재 레벨: {correspondingArtifact.currentLevel}"; // 현재 레벨 표시
    LevelUpAbilityText.text = nextAbilityText;
    if (correspondingArtifact.currentLevel > 0)
    {
        UnlockExplainText.text = "레벨업";
        ClickSkillCostText.text = BigIntegerUtils.FormatBigInteger(correspondingArtifact.CalculateUpgradeCost(correspondingArtifact.currentLevel));
    }
    else
    {
        ClickSkillCostText.text = BigIntegerUtils.FormatBigInteger(correspondingArtifact.unlockCost);
    }
}

public void SetSkillTexts(string nextAbilityText)
{
    SkillNameText.text = correspondingSkill.skillName;
    NowAbilityText.text = $"현재 레벨: {correspondingSkill.currentLevel}"; // 현재 레벨 표시
    LevelUpAbilityText.text = nextAbilityText;
    if (correspondingSkill.currentLevel > 0)
    {
        UnlockExplainText.text = "레벨업";
        ClickSkillCostText.text = BigIntegerUtils.FormatBigInteger(correspondingSkill.CalculateUpgradeCost(correspondingSkill.currentLevel));
    }
    else
    {
        ClickSkillCostText.text = BigIntegerUtils.FormatBigInteger(correspondingSkill.unlockCost);
    }
}

오늘 작업을 통해 스킬과 아티팩트의 팝업 UI가 개선되어 사용자에게 더 명확한 정보를 제공할 수 있게 되었습니다. 이러한 수정 사항들은 게임의 UX를 향상시키고, 사용자 경험을 보다 직관적으로 만들었습니다.

profile
게임개발자꿈나무

0개의 댓글