Files
Dino_Love_Simulation/Assets/02_Scripts/Communication/Dialog/DialogHudPlacement.cs

23 lines
1.5 KiB
C#

using System.Collections.Generic;
using UnityEngine;
// 이 캐릭터가 화자일 때 대화창(DialogHud)을 어디에 띄울지 캐릭터별로 지정한다.
// 진행 중인 대화에 다른 NPC의 대사가 끼어들 때도 화자 본인의 이 값이 쓰인다.
// 이 컴포넌트가 없으면 DialogHud 자체의 기본값으로 배치된다 (후보 자동 회피 없음).
// CharacterVoiceObject와 같은 오브젝트(NPC 루트)에 붙일 것.
public class DialogHudPlacement : MonoBehaviour
{
[Tooltip("배치 후보들 — 위에서부터 검사해 벽에 안 겹치고 안 가려지는 첫 후보 사용. " +
"각 후보가 완전한 배치값(높이/앞/좌우/회전)이며 캐릭터 크기에 맞게 조절할 것. " +
"전부 실패하면 첫 후보(기본)로 표시")]
public List<DialogHud.PlacementCandidate> Candidates = new()
{
new DialogHud.PlacementCandidate { Name = "기본", Height = 1.2f, Forward = 0.7f, Lateral = 0f },
new DialogHud.PlacementCandidate { Name = "우", Height = 1.2f, Forward = 0.5f, Lateral = 0.8f },
new DialogHud.PlacementCandidate { Name = "좌", Height = 1.2f, Forward = 0.5f, Lateral = -0.8f },
new DialogHud.PlacementCandidate { Name = "우상단", Height = 1.8f, Forward = 0.5f, Lateral = 0.5f },
new DialogHud.PlacementCandidate { Name = "좌상단", Height = 1.8f, Forward = 0.5f, Lateral = -0.5f },
new DialogHud.PlacementCandidate { Name = "중앙상단", Height = 2.0f, Forward = 0.5f, Lateral = 0f },
};
}