Skip to content

260310#12

Open
fish7576 wants to merge 10 commits into
mainfrom
jongmin
Open

260310#12
fish7576 wants to merge 10 commits into
mainfrom
jongmin

Conversation

@fish7576

@fish7576 fish7576 commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator

260310


공부한 것

  1. 애니메이터를 학습함
  2. 애니메이터의 파라미터에 대해 학습함
  3. sqrMagnitude 라는걸 사용해봄

구현한 내용

  1. 키보드를 누르는 방향으로 이미지가 뒤집히게 만듦
  2. 애니메이션을 추가함 움직일땐 움직임 애니메이션 서있을땐 대기 애니메이션

문제점

  1. PR제출이 하루 늦음 !!!!!!

    • 다음부터는 엄수할것
  2. 커밋을 깜빡해서 커밋을 굉장히 조금만함
    • 커밋하는 습관들이기

@uri0921-ctrl

Copy link
Copy Markdown
Collaborator

수고하셨습니다. 그래도 커밋 기록이 보기 쉽게 아주 깔끔해요! Move / Strand animation 구현 코드까지 잘 봤습니다.

@psvm203 psvm203 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

종민님 스터디하느라 고생하셨어요!

스터디 너무 잘해주셔서 감사드리고, 프로젝트 때도 기대하겠습니다!


private void OnTriggerStay2D(Collider2D other)
{
if (other.CompareTag("Player")) other.GetComponent<FarmerHp>().TakeDamage(Damage);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

가이드에서 언급하지는 않았지만, 같은 상황이라면 TryGetComponent를 쓰는 걸 추천드려요.

또한, 두 함수 모두 느린 편이라 업데이트나 충돌 감지 등 반복되는 로직에서 호출하면 성능에 문제가 생길 수 있어요.

다음에 기회가 된다면 이런 경우를 회피하는 방법에 대해 찾아보세요.

Comment on lines +22 to +27
if (_knockbackTimer > 0)
{
transform.Translate(_knockbackDirection * KnockbackPower * Time.deltaTime);
_knockbackTimer -= Time.deltaTime;
return;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이 코드에서는 문제가 없지만, 이런 코드가 많아지면 성능 문제가 발생할 수 있습니다.
유니티 코루틴에 대해 찾아보시면 도움 되실 거예요.

Comment on lines +21 to +28
if (_moveDirection.x > 0)
{
_spriteRenderer.flipX = false;
}
else if (_moveDirection.x < 0)
{
_spriteRenderer.flipX = true;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

주어진 조건에 따라 잘 구현하셨습니다.

만약, 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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

루프를 거치지 않고도 몬스터를 소환하는 방법이 있지 않을까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants