Conversation
Collaborator
|
수고하셨습니다. 그래도 커밋 기록이 보기 쉽게 아주 깔끔해요! Move / Strand animation 구현 코드까지 잘 봤습니다. |
psvm203
approved these changes
Mar 11, 2026
psvm203
left a comment
Contributor
There was a problem hiding this comment.
종민님 스터디하느라 고생하셨어요!
스터디 너무 잘해주셔서 감사드리고, 프로젝트 때도 기대하겠습니다!
|
|
||
| private void OnTriggerStay2D(Collider2D other) | ||
| { | ||
| if (other.CompareTag("Player")) other.GetComponent<FarmerHp>().TakeDamage(Damage); |
Contributor
There was a problem hiding this comment.
가이드에서 언급하지는 않았지만, 같은 상황이라면 TryGetComponent를 쓰는 걸 추천드려요.
또한, 두 함수 모두 느린 편이라 업데이트나 충돌 감지 등 반복되는 로직에서 호출하면 성능에 문제가 생길 수 있어요.
다음에 기회가 된다면 이런 경우를 회피하는 방법에 대해 찾아보세요.
Comment on lines
+22
to
+27
| if (_knockbackTimer > 0) | ||
| { | ||
| transform.Translate(_knockbackDirection * KnockbackPower * Time.deltaTime); | ||
| _knockbackTimer -= Time.deltaTime; | ||
| return; | ||
| } |
Contributor
There was a problem hiding this comment.
이 코드에서는 문제가 없지만, 이런 코드가 많아지면 성능 문제가 발생할 수 있습니다.
유니티 코루틴에 대해 찾아보시면 도움 되실 거예요.
Comment on lines
+21
to
+28
| if (_moveDirection.x > 0) | ||
| { | ||
| _spriteRenderer.flipX = false; | ||
| } | ||
| else if (_moveDirection.x < 0) | ||
| { | ||
| _spriteRenderer.flipX = true; | ||
| } |
Contributor
There was a problem hiding this comment.
주어진 조건에 따라 잘 구현하셨습니다.
만약, x 스케일을 -1로 설정하는 식으로 구현한다면 어떤 문제가 발생할까요?
Comment on lines
+29
to
+34
| do | ||
| { | ||
| Vector2 randomCircle = Random.insideUnitCircle * spawnRadius; | ||
| spawnPos = (Vector2)player.position + randomCircle; | ||
|
|
||
| } while (Vector2.Distance(spawnPos, player.position) < minDistance); |
Contributor
There was a problem hiding this comment.
루프를 거치지 않고도 몬스터를 소환하는 방법이 있지 않을까요?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
260310
공부한 것
구현한 내용
문제점
PR제출이 하루 늦음 !!!!!!