- Assets/_Game/ 하위로 게임 에셋 통합 - External/ 패키지 벤더별 분류 (Synty, Animations, UI) - 에셋 네이밍 컨벤션 확립 및 적용 (Data_Skill_, Data_SkillEffect_, Prefab_, Anim_, Model_, BT_ 등) - pre-commit hook으로 네이밍 컨벤션 자동 검사 추가 - RESTRUCTURE_CHECKLIST.md 작성 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using System;
|
|
using UnityEngine;
|
|
using Unity.Behavior;
|
|
using Unity.Properties;
|
|
using Condition = Unity.Behavior.Condition;
|
|
using Colosseum.Enemy;
|
|
|
|
namespace Colosseum.AI.BehaviorActions.Conditions
|
|
{
|
|
/// <summary>
|
|
/// 체력이 지정된 비율 이하인지 확인합니다.
|
|
/// </summary>
|
|
[Serializable, GeneratePropertyBag]
|
|
[NodeDescription(name: "Is Health Below", story: "Check if health is below [HealthPercent] percent", category: "Combat")]
|
|
public partial class IsHealthBelowCondition : Condition
|
|
{
|
|
[SerializeReference]
|
|
public BlackboardVariable<float> HealthPercent = new BlackboardVariable<float>(50f);
|
|
|
|
public override bool IsTrue()
|
|
{
|
|
EnemyBase enemy = GameObject.GetComponent<EnemyBase>();
|
|
|
|
if (enemy == null)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
float currentHealthPercent = (enemy.CurrentHealth / enemy.MaxHealth) * 100f;
|
|
return currentHealthPercent <= HealthPercent.Value;
|
|
}
|
|
}
|
|
}
|