-
Notifications
You must be signed in to change notification settings - Fork 3
2week #7
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
base: main
Are you sure you want to change the base?
2week #7
Conversation
|
|
||
| public class CamControl : MonoBehaviour | ||
| { | ||
| public GameObject player; //����ٴ� ������Ʈ ���� |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public 은 보안상 공개되어도 상관없는 수치에 붙이면 좋고, 이런 경우에는 굳이public 으로 설정할 필요가 없음!
[Serialized Field]를 붙이면 public 으로 했을 때와 동일하게 Hierarchy에 뜸
| } | ||
|
|
||
|
|
||
| if (toggleView == 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이렇게 번호로 하면 가독성이 떨어집니다! 코드 작성하다 실수할 수도 있어요.
enum으로 정의하면 더 좋아요.
가독성도 좋고 enum은 int로 처리가 가능해서 가볍게 사용할 수 있음.
언어 차원 에서 제공하는 기능이라 c# enum 혹은 unity enum 찾아보면 사용방법 나올 거예요
| { | ||
|
|
||
|
|
||
| if (Input.GetKeyDown("1")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이건 과제 같은 느낌으로 보면 좋을 것 같은데... 함 생각해보고 안되면 말아도 됨.
메이플 같은 거 하면 우리가 단축키 직접 설정할 수 있잖아
그런 방법을 사용하려면 이렇게 구현하면 안되겠지?
이 경우 어떻게 할 수 있을까?
이게맞나요..