Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player InputController에서 Input EventCallback 구현 #54

Merged
merged 2 commits into from
Jul 15, 2021

Conversation

Joseph-Cha
Copy link
Owner

구현 내용

Event를 활용해서 현재 눌린 키값에 따라 EventCallback을 하도록 했습니다.

리펙토링

하드 코딩으로 값을 가지고 오는 경우가 보이더라구요
nameof연산자를 활용해서 리펙토링을 조금 해보았습니다.

@Joseph-Cha Joseph-Cha requested a review from jongfeel June 27, 2021 04:13
@Joseph-Cha Joseph-Cha added the implement 구현 label Jun 27, 2021
@Joseph-Cha Joseph-Cha linked an issue Jun 27, 2021 that may be closed by this pull request
@Joseph-Cha Joseph-Cha added the refactoring 리펙토링 작업 label Jun 27, 2021
Copy link
Collaborator

@jongfeel jongfeel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이제 실제 이동 관련된 게임 화면을 연결해서 구현해 보면 될 거 같습니다.

switch(e.keyCode)
{
case KeyCode.RightArrow:
DirectoinInput?.Invoke(InputInfo.Right);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다시 보니까 InputInfo 대신에 그냥 KeyCode를 전달하는 것도 괜찮을 듯 합니다.

그러면 이런 switch case문은 안만들어도 되니까요.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네네 KeyCode Enum이 있는 것을 하다가 깨달았습니다 ㅋㅋ
위 부분은 실제 게임 화면 작업할 때 반영할게요!

@Joseph-Cha Joseph-Cha merged commit 1382ab4 into PlayerControllerUnitTest Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implement 구현 refactoring 리펙토링 작업
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[플레이어 이동] InputController Event Callback 구현
2 participants