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

[Day 13-1] PlayerManager 리팩토링 + NationStatManager구현

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

[2021. 7. 24, Sat]

어제 만든 것을 리뷰를 해보면서 생각을 해봤는데 나중에 플레이어 뿐만이 아니라 적국들도 똑같은 변수들을 만들어줘야한다. 그래서 모든 국가들의 현재 상태들을 관리하고 데이터를 저장하는 국가스텟관리자를 따로 만들었다.

Kicking off with reviewing works i made yesterday, I made a decision to come up with a Manager script on the idea that I wanna handle status quo of all nations.

 

NationStatManager.cs

플레이어 매니저에 있던 함수를 재사용성을 위해 스텟매니저에서 리팩토링을했다.

Refactored the aforementioned func in PlayerManager.cs moving to NationStatManager.cs to dispose required stats as would to any nations.

 

 

PlayerManager.cs

 

[+ 법에 따른 인구 증가률 조절 ] 

 

[정리된 PlayerManager.cs]

[Refacotring PlayerManager.cs]

728x90