집씬으로 넘기기

This commit is contained in:
2026-07-14 16:34:20 +09:00
parent b87651b186
commit e0be196bbb
15 changed files with 213 additions and 20 deletions

View File

@@ -45,4 +45,8 @@ public class DialogNode : ScriptableObject
[Header("Event")]
public string EventKey; // 비어있지 않으면 이 노드가 재생될 때 DialogPlayer가 같은 Key의 이벤트를 호출
[Header("Story")]
[Tooltip("0이 아니면 이 노드 재생 시 화자(비우면 대화 주인 NPC)의 호감도를 이만큼 증감")]
public int Affection;
}

View File

@@ -368,6 +368,13 @@ private async Awaitable PlayNode(DialogNode node)
RaiseNodeEvent(node.EventKey); // EventKey 있으면 매칭 이벤트 호출
// 호감도 증감 — 화자 기준, 화자가 비어 있으면 대화 주인 NPC
if (node.Affection != 0)
{
var affectionTarget = node.Speaker != null ? node.Speaker : _voice.Character;
StoryManager.Instance.AddAffection(affectionTarget, node.Affection);
}
// 전용 BGM: 설정돼 있으면 교체, 비어 있으면 기본 BGM으로 복귀
if (SoundManager.Instance != null)
{

View File

@@ -97,6 +97,7 @@ public override void OnImportAsset(AssetImportContext ctx)
dn.LookAtPlayer = GetInputPortValue<bool>(gn.GetInputPortByName(DialogLineNode.PORT_LOOKAT));
dn.ForcePlayerLook = GetInputPortValue<bool>(gn.GetInputPortByName(DialogLineNode.PORT_FORCELOOK));
dn.WaitForInput = GetInputPortValue<bool>(gn.GetInputPortByName(DialogLineNode.PORT_WAITINPUT));
dn.Affection = GetInputPortValue<int>(gn.GetInputPortByName(DialogLineNode.PORT_AFFECTION));
string eventKey = null;
line.GetNodeOptionByName(DialogLineNode.OPTION_EVENT_KEY)?.TryGetValue(out eventKey);
@@ -143,6 +144,7 @@ static void FillStagingNode(DialogStagingNode gn, DialogNode dn)
dn.LineDuration = GetInputPortValue<float>(gn.GetInputPortByName(DialogStagingNode.PORT_DURATION));
dn.LookAtPlayer = GetInputPortValue<bool>(gn.GetInputPortByName(DialogStagingNode.PORT_LOOKAT));
dn.ForcePlayerLook = GetInputPortValue<bool>(gn.GetInputPortByName(DialogStagingNode.PORT_FORCELOOK));
dn.Affection = GetInputPortValue<int>(gn.GetInputPortByName(DialogStagingNode.PORT_AFFECTION));
string eventKey = null;
gn.GetNodeOptionByName(DialogStagingNode.OPTION_EVENT_KEY)?.TryGetValue(out eventKey);

View File

@@ -27,6 +27,7 @@ internal class DialogLineNode : DialogGraphNode
public const string PORT_LOOKAT = "LookAtPlayer";
public const string PORT_FORCELOOK = "ForcePlayerLook";
public const string PORT_WAITINPUT = "WaitForInput";
public const string PORT_AFFECTION = "Affection";
public const string PORT_QUESTION = "ChoiceQuestion";
public const string OPTION_CHOICE_COUNT = "ChoiceCount";
@@ -74,6 +75,8 @@ protected override void OnDefinePorts(IPortDefinitionContext context)
context.AddInputPort<bool>(PORT_FORCELOOK).WithDisplayName("Force Player Look")
.WithTooltip("이 대사 시작 시 플레이어(카메라)가 화자를 바라보도록 강제 회전").Build();
context.AddInputPort<bool>(PORT_WAITINPUT).WithDisplayName("Wait For Input").Build();
context.AddInputPort<int>(PORT_AFFECTION).WithDisplayName("Affection ±")
.WithTooltip("0이 아니면 이 대사 재생 시 화자(비우면 대화 주인 NPC)의 호감도를 이만큼 증감").Build();
int choiceCount = 0;
GetNodeOptionByName(OPTION_CHOICE_COUNT)?.TryGetValue(out choiceCount);

View File

@@ -19,6 +19,7 @@ internal class DialogStagingNode : DialogGraphNode
public const string PORT_DURATION = "Duration";
public const string PORT_LOOKAT = "LookAtPlayer";
public const string PORT_FORCELOOK = "ForcePlayerLook";
public const string PORT_AFFECTION = "Affection";
public const string OPTION_EVENT_KEY = "EventKey";
@@ -48,6 +49,8 @@ protected override void OnDefinePorts(IPortDefinitionContext context)
.WithTooltip("대상 캐릭터가 플레이어를 바라봄").Build();
context.AddInputPort<bool>(PORT_FORCELOOK).WithDisplayName("Force Player Look")
.WithTooltip("플레이어가 대상 캐릭터를 바라봄").Build();
context.AddInputPort<int>(PORT_AFFECTION).WithDisplayName("Affection ±")
.WithTooltip("0이 아니면 이 연출 재생 시 대상(비우면 대화 주인 NPC)의 호감도를 이만큼 증감").Build();
AddExecOutput(context, EXEC_OUT, string.Empty);
}