PlayerController 테스트 코드 작성#51
Conversation
jongfeel
left a comment
There was a problem hiding this comment.
테스트 코드의 while loop 이해하는데 조금 어려운 것 같습니다.
쉬운 방법으로 해봤으면 좋겠네요.
또, Player.UpdateDestination() method가 없는 거 같은데 빌드가 됐나요?
| var obj = new GameObject(); | ||
| Player player = obj.AddComponent<Player>(); | ||
| InputInfo inputInfo; | ||
| Vector2Int curPos = player.Position; |
There was a problem hiding this comment.
player.Position is (0, 0)?
| } | ||
|
|
||
| frameCount++; | ||
| } while(frameCount <= 10); |
There was a problem hiding this comment.
Up: 4 step
Down: 1 step
Right: 1 step
Left: 3 step
Start position is (0, 0), it will be changes to (-2, 3) until while loop.
But, start position is (1, 1) to (-1, 2). right?
There was a problem hiding this comment.
-2, 3이 맞아요 ㅋㅋㅋ
frameCount++를 하고 이동하는 줄 알고 계산을 했었는데
이동을 다하고 frameCount++를 하는 거였군요 ㅋㅋ;;
일단 while 루프가 좀 애매한 것 같아서 다른 방법을 찾아볼게요!
There was a problem hiding this comment.
커밋 : 1fe033d
랜덤으로 이동한 위치가 원하는 위치인지 테스트하는 방식으로 수정했어요~
Player 스크립트를 안올렸었군요;;;; |
|
실제 UI로 보여질 수 있게 하면 좋을 것 같습니다.
등등 |
커밋 : 836662c 전에 올리지 못했던 Player 스크립트입니다~ |
테스트 코드 설계 참고 : #47
이슈에 남겼던 테스트 코드 설계했던 대로 작성을 해보았습니다.
아마 작업하다 보면 좀 수정이 예상되지만 우선 최대한 저 테스트를 기반으로 구현을 해볼게요.