feat: 패시브 트리 프로토타입 구현
- 패시브 트리/노드/프리셋 데이터와 카탈로그 참조 구조를 추가하고 Resources 의존을 Data/Passives 자산 구조로 정리 - 플레이어 런타임, 전투 계수, 프리셋 적용, 멀티플레이 동기화 경로에 패시브 적용 로직 연결 - 프리팹 기반 패시브 트리 UI와 노드 아이콘/프리셋/상세 패널 흐름을 추가하고 HUD에 연동 - 패시브 디버그/부트스트랩 메뉴와 UI 프리팹 재생성 경로를 추가
This commit is contained in:
67
Assets/_Game/Scripts/Passives/PassiveNodeData.cs
Normal file
67
Assets/_Game/Scripts/Passives/PassiveNodeData.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace Colosseum.Passives
|
||||
{
|
||||
/// <summary>
|
||||
/// 패시브 트리의 단일 노드 데이터입니다.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "PassiveNode", menuName = "Colosseum/Passives/Passive Node")]
|
||||
public class PassiveNodeData : ScriptableObject
|
||||
{
|
||||
[Header("기본 정보")]
|
||||
[SerializeField] private string nodeId;
|
||||
[SerializeField] private string displayName;
|
||||
[TextArea(2, 4)]
|
||||
[SerializeField] private string description;
|
||||
[SerializeField] private PassiveNodeBranch branch = PassiveNodeBranch.Common;
|
||||
[SerializeField] private PassiveNodeKind nodeKind = PassiveNodeKind.Axis;
|
||||
[SerializeField] private PassiveAxisMask axisMask = PassiveAxisMask.None;
|
||||
[Min(0)] [SerializeField] private int tier = 0;
|
||||
[Min(0)] [SerializeField] private int cost = 1;
|
||||
|
||||
[Header("트리 레이아웃")]
|
||||
[Tooltip("트리 그래프 안에서 사용할 정규화 좌표 (-1 ~ 1 권장)")]
|
||||
[SerializeField] private Vector2 layoutPosition = Vector2.zero;
|
||||
|
||||
[Header("연결 정보")]
|
||||
[SerializeField] private List<PassiveNodeData> prerequisiteNodes = new();
|
||||
[SerializeField] private List<PassiveNodeData> connectedNodes = new();
|
||||
|
||||
[Header("효과")]
|
||||
[SerializeField] private List<PassiveEffectEntry> effects = new();
|
||||
|
||||
public string NodeId => nodeId;
|
||||
public string DisplayName => displayName;
|
||||
public string Description => description;
|
||||
public PassiveNodeBranch Branch => branch;
|
||||
public PassiveNodeKind NodeKind => nodeKind;
|
||||
public PassiveAxisMask AxisMask => axisMask;
|
||||
public int Tier => tier;
|
||||
public int Cost => cost;
|
||||
public Vector2 LayoutPosition => layoutPosition;
|
||||
public IReadOnlyList<PassiveNodeData> PrerequisiteNodes => prerequisiteNodes;
|
||||
public IReadOnlyList<PassiveNodeData> ConnectedNodes => connectedNodes;
|
||||
public IReadOnlyList<PassiveEffectEntry> Effects => effects;
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(nodeId))
|
||||
{
|
||||
nodeId = name;
|
||||
}
|
||||
|
||||
if (axisMask == PassiveAxisMask.None)
|
||||
{
|
||||
axisMask = branch switch
|
||||
{
|
||||
PassiveNodeBranch.Attack => PassiveAxisMask.Attack,
|
||||
PassiveNodeBranch.Defense => PassiveAxisMask.Defense,
|
||||
PassiveNodeBranch.Support => PassiveAxisMask.Support,
|
||||
_ => PassiveAxisMask.None,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user