chore: Assets 디렉토리 구조 정리 및 네이밍 컨벤션 적용
- 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>
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using Colosseum.Skills;
|
||||
using Unity.Behavior;
|
||||
using UnityEngine;
|
||||
using Action = Unity.Behavior.Action;
|
||||
using Unity.Properties;
|
||||
|
||||
/// <summary>
|
||||
/// 지정된 스킬을 사용하는 Behavior Tree Action.
|
||||
/// 스킬 실행이 완료될 때까지 Running 상태를 유지합니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(name: "Use Skill", story: "[스킬] 사용", category: "Action", id: "799f1e8cfafa78b2d52ef61a6bbb29b9")]
|
||||
public partial class UseSkillAction : Action
|
||||
{
|
||||
[SerializeReference] public BlackboardVariable<SkillData> 스킬;
|
||||
|
||||
private SkillController skillController;
|
||||
|
||||
protected override Status OnStart()
|
||||
{
|
||||
// 스킬 데이터 확인
|
||||
if (스킬?.Value == null)
|
||||
{
|
||||
Debug.LogWarning("[UseSkillAction] 스킬이 null입니다.");
|
||||
return Status.Failure;
|
||||
}
|
||||
|
||||
// SkillController 컴포넌트 가져오기
|
||||
skillController = GameObject.GetComponent<SkillController>();
|
||||
if (skillController == null)
|
||||
{
|
||||
Debug.LogWarning($"[UseSkillAction] SkillController를 찾을 수 없습니다: {GameObject.name}");
|
||||
return Status.Failure;
|
||||
}
|
||||
|
||||
// 스킬 실행 시도
|
||||
bool success = skillController.ExecuteSkill(스킬.Value);
|
||||
if (!success)
|
||||
{
|
||||
// 이미 다른 스킬 사용 중이거나 쿨타임
|
||||
return Status.Failure;
|
||||
}
|
||||
|
||||
return Status.Running;
|
||||
}
|
||||
|
||||
protected override Status OnUpdate()
|
||||
{
|
||||
// SkillController가 해제된 경우
|
||||
if (skillController == null)
|
||||
{
|
||||
return Status.Failure;
|
||||
}
|
||||
|
||||
// 스킬 애니메이션이 종료되면 성공
|
||||
if (!skillController.IsPlayingAnimation)
|
||||
{
|
||||
return Status.Success;
|
||||
}
|
||||
|
||||
return Status.Running;
|
||||
}
|
||||
|
||||
protected override void OnEnd()
|
||||
{
|
||||
skillController = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user