Monstercontrol 코드 수정

데이터테이블 기반 기본 값 추가, 애니메이션 수정
This commit is contained in:
Mingu Kim
2025-02-03 23:59:23 +09:00
parent 6850d3b80a
commit 7e81853eed
2 changed files with 22 additions and 1 deletions

View File

@@ -12101,6 +12101,10 @@ PrefabInstance:
propertyPath: m_Name
value: 1_Alternative_Colour_Cat_Idle
objectReference: {fileID: 0}
- target: {fileID: -2253911629886400664, guid: 06e11f99937f3f940bcf4f4bbb0a9fad, type: 3}
propertyPath: m_TagString
value: Player
objectReference: {fileID: 0}
- target: {fileID: 7878350319992209165, guid: 06e11f99937f3f940bcf4f4bbb0a9fad, type: 3}
propertyPath: m_LocalScale.x
value: 10

View File

@@ -7,7 +7,19 @@ namespace TON
{
public class MonsterControl : MonoBehaviour
{
public float speed = 2;
public int id; // 적 고유 ID
public string name; // 적 이름
public int hp; // HP
public int damage; // 공격력
public int defense; // 방어력
public int speed = 2; // 이동속도
public string aiType; // AI 패턴?
public int dropItems; // 드롭 아이템 ID
public int eXperiencePoint; // 경험치?
public Animator animator;
GameObject target;
@@ -15,6 +27,9 @@ namespace TON
void Start()
{
target = GameObject.FindGameObjectWithTag("Player");
animator = GetComponent<Animator>();
}
// Update is called once per frame
@@ -30,6 +45,8 @@ namespace TON
// 방향 * 속도 * 시간간격
transform.Translate(direction.normalized * speed * Time.deltaTime);
// animator.SetBool("Iidle", true);
animator.SetBool("Walk", true ); // 걷기 애니메이션
}
}
}