warring 경고 제거
This commit is contained in:
@@ -25190,7 +25190,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 866829734583457878, guid: 1e126f96ebcf4245a3328353992d46f6, type: 3}
|
||||
propertyPath: m_CategoryHash
|
||||
value: 0.009161512
|
||||
value: 1.0429618e-14
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 866829734583457880, guid: 1e126f96ebcf4245a3328353992d46f6, type: 3}
|
||||
propertyPath: m_FlipX
|
||||
@@ -25199,7 +25199,7 @@ PrefabInstance:
|
||||
- target: {fileID: 866829734583457880, guid: 1e126f96ebcf4245a3328353992d46f6, type: 3}
|
||||
propertyPath: m_Sprite
|
||||
value:
|
||||
objectReference: {fileID: 4723107735738678597, guid: 8c818873fb8d4ad3bb40ebb62d906a1d, type: 3}
|
||||
objectReference: {fileID: 1856677538, guid: 8c818873fb8d4ad3bb40ebb62d906a1d, type: 3}
|
||||
- target: {fileID: 866829735663616562, guid: 1e126f96ebcf4245a3328353992d46f6, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: BlueDragon
|
||||
@@ -50707,7 +50707,7 @@ Rigidbody2D:
|
||||
m_Simulated: 1
|
||||
m_UseFullKinematicContacts: 0
|
||||
m_UseAutoMass: 0
|
||||
m_Mass: 1
|
||||
m_Mass: 0.0001
|
||||
m_LinearDrag: 0
|
||||
m_AngularDrag: 0.05
|
||||
m_GravityScale: 1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
@@ -67,8 +68,12 @@ namespace TON
|
||||
// todo : 충돌 했으면 attack 전환 (바로 그냥 공격하게 따라가지 말고)
|
||||
// todo : 시야를 벗어났으면 idle 전환
|
||||
|
||||
_isDetect = false;
|
||||
|
||||
if (_isDetect)
|
||||
{
|
||||
_animator.SetTrigger("Attack");
|
||||
_isWalking = false;
|
||||
}
|
||||
|
||||
if (_isWalking)
|
||||
{
|
||||
// walking 상태에서 walkingTime을 초과할 경우 idle 애니메이션 재생
|
||||
@@ -97,14 +102,7 @@ namespace TON
|
||||
_isWalking = true;
|
||||
}
|
||||
}
|
||||
|
||||
// if (_isHit)
|
||||
// {
|
||||
// _animator.SetBool("Attack", _isDetect);
|
||||
//
|
||||
// _isWalking = false;
|
||||
//
|
||||
// }
|
||||
|
||||
_animator.SetBool("Walk", _isWalking); // 걷기 애니메이션
|
||||
}
|
||||
|
||||
@@ -143,6 +141,7 @@ namespace TON
|
||||
|
||||
void MonsterAttack(GameObject player)
|
||||
{
|
||||
_animator.SetTrigger("Attack");
|
||||
// 임시 반영 수정 예정
|
||||
DamageCalculator damageCalculator = new DamageCalculator();
|
||||
|
||||
@@ -158,20 +157,17 @@ namespace TON
|
||||
|
||||
private void OnCollisionEnter2D(Collision2D other)
|
||||
{
|
||||
_isDetect = true;
|
||||
|
||||
if (other.collider.CompareTag("Player"))
|
||||
{
|
||||
|
||||
_animator.SetBool("Attack", true); // 공격 애니메이션 재생
|
||||
_isDetect = true;
|
||||
MonsterAttack(other.gameObject); // 플레이어에게 공격
|
||||
Debug.Log("감지됨");
|
||||
}
|
||||
}
|
||||
|
||||
if (!other.collider.CompareTag("Player"))
|
||||
{
|
||||
_isDetect = false;
|
||||
}
|
||||
private void OnCollisionExit2D(Collision2D other)
|
||||
{
|
||||
_isDetect = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user