- 다중 젬 슬롯용 타입을 별도 스크립트로 분리하고 테스트 젬/로드아웃 자산 생성 경로를 정리 - 젬 테스트 전용 공격 스킬과 분리된 애니메이션 자산을 추가해 베이스 스킬 검증 경로를 마련 - PlayerSkillDebugMenu와 MPP 디버그 메뉴를 보강해 젬 프리셋 적용, 원격 테스트, 보스 기절 디버그 메뉴를 추가 - BossCombatBehaviorContext와 공통 BT 액션이 기절 상태를 존중하도록 수정해 보스 추적과 패턴 실행을 중단 - Unity 리프레시와 외부 빌드 통과를 확인하고 드로그전 및 MPP 기준 젬 프리셋 적용 흐름을 검증
92 lines
2.5 KiB
C#
92 lines
2.5 KiB
C#
using System;
|
|
using Colosseum.Enemy;
|
|
using Unity.Behavior;
|
|
using UnityEngine;
|
|
using Action = Unity.Behavior.Action;
|
|
using Unity.Properties;
|
|
|
|
[Serializable, GeneratePropertyBag]
|
|
[NodeDescription(name: "ChaseTarget", story: "타겟 추적", category: "Action", id: "0889fbb015b8bf414ef569af08bb6868")]
|
|
public partial class ChaseTargetAction : Action
|
|
{
|
|
|
|
[SerializeReference]
|
|
public BlackboardVariable<GameObject> Target;
|
|
|
|
[SerializeReference]
|
|
public BlackboardVariable<float> Speed = new BlackboardVariable<float>(0f);
|
|
|
|
[SerializeReference]
|
|
public BlackboardVariable<float> StopDistance = new BlackboardVariable<float>(2f);
|
|
|
|
private UnityEngine.AI.NavMeshAgent agent;
|
|
|
|
protected override Status OnStart()
|
|
{
|
|
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
|
|
if (context != null && context.IsBehaviorSuppressed)
|
|
{
|
|
return Status.Failure;
|
|
}
|
|
|
|
if (Target.Value == null)
|
|
{
|
|
return Status.Failure;
|
|
}
|
|
|
|
agent = GameObject.GetComponent<UnityEngine.AI.NavMeshAgent>();
|
|
if (agent == null)
|
|
{
|
|
Debug.LogWarning("[ChaseTarget] NavMeshAgent not found");
|
|
return Status.Failure;
|
|
}
|
|
|
|
// Speed가 0 이하면 NavMeshAgent의 기존 speed 유지 (EnemyData에서 설정한 값)
|
|
if (Speed.Value > 0f)
|
|
{
|
|
agent.speed = Speed.Value;
|
|
}
|
|
agent.stoppingDistance = StopDistance.Value;
|
|
agent.isStopped = false;
|
|
|
|
return Status.Running;
|
|
}
|
|
|
|
protected override Status OnUpdate()
|
|
{
|
|
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
|
|
if (context != null && context.IsBehaviorSuppressed)
|
|
{
|
|
if (agent != null)
|
|
agent.isStopped = true;
|
|
|
|
return Status.Failure;
|
|
}
|
|
|
|
if (Target.Value == null)
|
|
{
|
|
return Status.Failure;
|
|
}
|
|
|
|
// 이미 사거리 내에 있으면 성공
|
|
float distance = Vector3.Distance(GameObject.transform.position, Target.Value.transform.position);
|
|
if (distance <= StopDistance.Value)
|
|
{
|
|
agent.isStopped = true;
|
|
return Status.Success;
|
|
}
|
|
|
|
agent.SetDestination(Target.Value.transform.position);
|
|
return Status.Running;
|
|
}
|
|
|
|
protected override void OnEnd()
|
|
{
|
|
if (agent != null)
|
|
{
|
|
agent.isStopped = true;
|
|
}
|
|
}
|
|
}
|
|
|