feat: 드로그 공통 보스 BT 프레임워크 정리

This commit is contained in:
2026-03-23 16:02:45 +09:00
parent 3ae3cbcac1
commit de2cb2194e
65 changed files with 4514 additions and 2374 deletions

View File

@@ -0,0 +1,46 @@
using System;
using Colosseum.Enemy;
using Unity.Behavior;
using Unity.Properties;
using UnityEngine;
using Action = Unity.Behavior.Action;
/// <summary>
/// 보스의 주 대상을 갱신하는 공통 Behavior Action입니다.
/// </summary>
[Serializable, GeneratePropertyBag]
[NodeDescription(
name: "Refresh Primary Target",
story: "보스 주 대상을 [Target] ",
category: "Action",
id: "b7dbb1fc0c0d451795e9f02d6f4d3930")]
public partial class RefreshPrimaryTargetAction : Action
{
[SerializeReference]
public BlackboardVariable<GameObject> Target;
protected override Status OnStart()
{
EnemyBase enemyBase = GameObject.GetComponent<EnemyBase>();
if (enemyBase == null)
return Status.Failure;
GameObject currentTarget = Target != null ? Target.Value : null;
float aggroRange = enemyBase.Data != null ? enemyBase.Data.AggroRange : Mathf.Infinity;
GameObject resolvedTarget = enemyBase.GetHighestThreatTarget(currentTarget, null, aggroRange);
if (resolvedTarget == null)
{
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
resolvedTarget = context != null ? context.FindNearestLivingTarget() : null;
}
if (Target != null)
Target.Value = resolvedTarget;
return resolvedTarget != null ? Status.Success : Status.Failure;
}
}