본문 바로가기
개발 (Game)/(2021) Unity RTS 포트폴리오

[Day 13-2] 경제 주요 기능 추가(1)

by 진현개발일기 2021. 7. 24.

[2021. 07. 24, Sat]

주말이라서 그런지 집중이 잘 안됐지만 뒤에 할 것들이 잔뜩 쌓여있어서 최대한 열심히는 해봤다. 

추후에 다시 리뷰해서 리팩토링 해봐야겠다.

Since its on weekend, I was pretty keen of having a little break.. but i gotta do my work 'casue im way behind on my works.

 

오늘 한 것들은 이렇다.

let me jot down what ive done today.

 

[오늘 한 것들]

1. 실업자, 빈곤층 각각의 비율에 따라 납세자가 몇 명인지 정해진다. 그에따른 수입도 달라진다.

   Both unemployment rate and poor rate are taken into account to set the number of tax-payers when you collect taxes.

2. 정치UI에서 개정한 법들이, 아직은 인구 증감률에만, 경제에 지속적으로 미친다.

    Measures set by player, yet only population growth&decline rate are hit by the effect, have influence on economy. 

3. 세금과 금리를 설정할 수 있다.

    (금리 기능은 아직 구현 안됐다)

   Although the func by interest is not organized, you can set the income tax rate and interest rate.

 

4. 경제-> 예산 UI에 있는 5개 경제 부문의 예산 비율들을 슬라이더로 조절 할 수 있고, 예상 지출액이 특정 금액보다(비율) 높다면 경고가 뜨게한다. 

  you can balance the treasury usage among 5 buisnesses by slider in Treasury UI. Warning notification will pop up in advance when you're trying to overuse treasury.

 

[경제 클래스]

[Economy Class]

1
2
납세자 함수
따라서, 국가를 만들 때 처음 가지고 있는 예산은 랜덤으로 된다.
PlayerManager.cs

 

[리팩토링 전 세금, 금리 함수]

[Before Refactoring]

 

[리팩토링 후 세금, 금리 함수]

[After Refactoring]

리팩토링 성공

▲ 세금, 금리를 조절 했을 때다. (Tax rate & interest rate changed)

 

NationStatusManager.cs
NationStatusManager.cs

 

 

[현재 경제관련 함수들]

[ economy-related funcs ]

 

[▼ 알람UI  ]

 

 

 

[▼ 오늘자 PlayerManager.cs , Update함수 (필요할때만 딱 한 번씩 씀) ]

 

 

[▼ 오늘자 ButtonManager.cs ]

560줄 나오는데 이거 괜찮은거겠지??;;

 

 

[▼ 오늘자 NationStatusManager.cs ]

 

 

 

위에 것들 다 구현이 되는데 깜빡하고 영상을 안찍어놨따 넘 피곤하니깐 낼 해야겠다

 

수정해야할 부분은 예산 비율을 변경하면 바로 바뀌도록 설계를 해놨는데 설계가 잘못되었다.

턴에 따라서 서서히 변해야한다.

728x90