-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(HW2) #16
base: main
Are you sure you want to change the base?
feat(HW2) #16
Conversation
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.
전체적으로 코드 깔끔하게 잘 만드신거 같네요. 다른 종류의 무기도 한번 추가해보죠
private void Start() | ||
{ | ||
player = GameObject.Find("Player").transform; | ||
} | ||
|
||
void Update() | ||
{ |
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.
깔끔하게 잘 구현하셨네요
enemyObject.GetComponent<SpriteRenderer>().color = PickRandomColor(); | ||
GameObject enemy = Instantiate(enemyPrefab, PickRandomPosition(), Quaternion.identity); | ||
enemy.transform.SetParent(transform); // ������ ���� �θ� ������Ʈ�� �߰� | ||
enemy.GetComponent<SpriteRenderer>().color = PickRandomColor(); |
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.
적 생성후 부모 오브젝트에 추가하는거 좋네요
|
||
private Rigidbody2D rb; | ||
|
||
[SerializeField] private float moveSpeed; |
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.
다른 의도가 있었는지는 모르겠는데, [SerializeField]는 기본적으로 private속성을 가지고 있기 때문에 뒤에 private를 안 달아도 됩니다.
} | ||
|
||
private void Move() | ||
{ |
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.
Update의 xInput과 yInput 변수들을 Move함수 내에서 정의하는게 더 깔끔할거 같네요.
|
||
// Ÿ�� �������� �̵� | ||
Vector3 direction = (target.position - transform.position).normalized; | ||
transform.position += direction * speed * Time.deltaTime; |
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.
타겟이 없으면 화살삭제, 타겟 방향으로 이동
위 코드들도 다 함수로 만들어서 Update에 넣으면 좀더 깔끔한 코드가 될거 같네요
} | ||
} | ||
|
||
return closestEnemy; |
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.
함수구현 이쁘게 잘되었네요. 좋습니다
코멘트 확인 수정 하고 코멘트 달아주시면 merge하겠습니다~ |
변경점 👍
새로 구현한 기능 및 주요 변경점
단검 공격 구현
버그 해결 💊
해결한 버그
리팩토링 🛠
리팩토링 내역
스크린샷 🖼
변경된 부분에 대한 스크린샷
비고 ✏
리뷰어에게 전하는 말 등
사용하지 않은 항목은 모두 지워주세요.