2026-04-24 커뮤니케이션 시스템
This commit is contained in:
8
Assets/02_Scripts/Communication.meta
Normal file
8
Assets/02_Scripts/Communication.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: eb6d4501b8312bd45b64f94666429fce
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/02_Scripts/Communication/Dialog.meta
Normal file
8
Assets/02_Scripts/Communication/Dialog.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4e1fa77a8f96cfa499f3381d7a03bb12
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/02_Scripts/Communication/Dialog/DialogChoice.cs
Normal file
8
Assets/02_Scripts/Communication/Dialog/DialogChoice.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class DialogChoice
|
||||||
|
{
|
||||||
|
public DialogNode DestinationNode;
|
||||||
|
public string ChoiceText;
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 53b0b23b66f7c2c4f999504013357bae
|
||||||
8
Assets/02_Scripts/Communication/Dialog/DialogGroup.cs
Normal file
8
Assets/02_Scripts/Communication/Dialog/DialogGroup.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
[CreateAssetMenu(menuName = "Communication/Dialog Group")]
|
||||||
|
public class DialogGroup : ScriptableObject
|
||||||
|
{
|
||||||
|
public string DialogGroupName;
|
||||||
|
public DialogNode StartNode;
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1391123ae67c59242b2ba15388efd65b
|
||||||
25
Assets/02_Scripts/Communication/Dialog/DialogNode.cs
Normal file
25
Assets/02_Scripts/Communication/Dialog/DialogNode.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
[CreateAssetMenu(menuName = "Communication/Dialog Node")]
|
||||||
|
public class DialogNode : ScriptableObject
|
||||||
|
{
|
||||||
|
[Header("Speaker")]
|
||||||
|
public CharacterData Speaker;
|
||||||
|
|
||||||
|
[Header("Content")]
|
||||||
|
[TextArea(2,5)] public string TalkText;
|
||||||
|
public GestureData Gesture;
|
||||||
|
public ExpressionData Expression;
|
||||||
|
public VoiceClip Voice;
|
||||||
|
public float LineDuration; //자동 넘김 시간
|
||||||
|
//LineDuration=0 → 플레이어 입력 대기 (수동)
|
||||||
|
//Voice 있음 → 클립 길이만큼 대기
|
||||||
|
//Voice 없음 → LineDuration 대기
|
||||||
|
|
||||||
|
|
||||||
|
[Header("Flow")]
|
||||||
|
public DialogNode Next; // 선택지 없을 때 자동으로 갈 노드
|
||||||
|
public List<DialogChoice> Choices; // 있으면 플레이어 선택 대기
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 120455f2b87acc14c9b01cab221c71eb
|
||||||
24
Assets/02_Scripts/Communication/Dialog/DialogPlayer.cs
Normal file
24
Assets/02_Scripts/Communication/Dialog/DialogPlayer.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class DialogPlayer : MonoBehaviour
|
||||||
|
{
|
||||||
|
[SerializeField] private List<DialogGroup> _dialogGroups;
|
||||||
|
private Dictionary<string, DialogGroup> _dialogGroupMap;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
_dialogGroupMap = new Dictionary<string, DialogGroup>();
|
||||||
|
foreach (var g in _dialogGroups)
|
||||||
|
{
|
||||||
|
_dialogGroupMap[g.DialogGroupName] = g;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void VoicePlay(DialogNode node)
|
||||||
|
{
|
||||||
|
|
||||||
|
//CharacterVoiceObject speakerVoiceObject = FindSpeakerVoiceObject(node.Speaker);
|
||||||
|
//speakerVoiceObject.Play(node.Voice.Clip);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9e349795efd8d1445b33cddf0442db11
|
||||||
8
Assets/02_Scripts/Communication/Voice.meta
Normal file
8
Assets/02_Scripts/Communication/Voice.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e2502925ef2616a429da6f70b887176a
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class CharacterVoiceObject : MonoBehaviour
|
||||||
|
{
|
||||||
|
public CharacterData Character;
|
||||||
|
public AudioSource VoiceSource;
|
||||||
|
|
||||||
|
public void Play(AudioClip clip) => VoiceSource.PlayOneShot(clip);
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f7b9cbce15ac9074ca0a54f7837824b8
|
||||||
8
Assets/02_Scripts/Data/Character.meta
Normal file
8
Assets/02_Scripts/Data/Character.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5f885cca7d988aa4db7692d1b7dc15e5
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
9
Assets/02_Scripts/Data/Character/CharacterData.cs
Normal file
9
Assets/02_Scripts/Data/Character/CharacterData.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
[CreateAssetMenu(menuName = "Character/CharacterData")]
|
||||||
|
public class CharacterData : ScriptableObject
|
||||||
|
{
|
||||||
|
public string Id;
|
||||||
|
public string Name;
|
||||||
|
public Sprite Portrait;
|
||||||
|
}
|
||||||
2
Assets/02_Scripts/Data/Character/CharacterData.cs.meta
Normal file
2
Assets/02_Scripts/Data/Character/CharacterData.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0446c9fbb574c5242beeae1ece853b87
|
||||||
8
Assets/02_Scripts/Data/Communication.meta
Normal file
8
Assets/02_Scripts/Data/Communication.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f57c57748092259458a9d5dc3db640d9
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
10
Assets/02_Scripts/Data/Communication/ExpressionData.cs
Normal file
10
Assets/02_Scripts/Data/Communication/ExpressionData.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
[CreateAssetMenu(menuName = "Communication/Expression")]
|
||||||
|
public class ExpressionData : ScriptableObject
|
||||||
|
{
|
||||||
|
[HideInInspector] public int AnimationLayer = 1;
|
||||||
|
public string StateName;
|
||||||
|
public float CrossFadeDuration = 0.2f;
|
||||||
|
public AnimationClip PreviewClip;
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 197305103c49bf349a3a749f48a4513e
|
||||||
10
Assets/02_Scripts/Data/Communication/GestureData.cs
Normal file
10
Assets/02_Scripts/Data/Communication/GestureData.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
[CreateAssetMenu(menuName = "Communication/Gesture")]
|
||||||
|
public class GestureData : ScriptableObject
|
||||||
|
{
|
||||||
|
[HideInInspector] public int AnimationLayer = 0;
|
||||||
|
public string StateName;
|
||||||
|
public float CrossFadeDuration = 0.2f;
|
||||||
|
public AnimationClip PreviewClip;
|
||||||
|
}
|
||||||
2
Assets/02_Scripts/Data/Communication/GestureData.cs.meta
Normal file
2
Assets/02_Scripts/Data/Communication/GestureData.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 59589a6a14790d546aa8c5979fbb71ef
|
||||||
8
Assets/02_Scripts/Data/Communication/VoiceClip.cs
Normal file
8
Assets/02_Scripts/Data/Communication/VoiceClip.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
[CreateAssetMenu(menuName = "Communication/VoiceClip")]
|
||||||
|
public class VoiceClip : ScriptableObject
|
||||||
|
{
|
||||||
|
public string VoiceCode; //해당 음성 고유코드
|
||||||
|
public AudioClip Clip;
|
||||||
|
}
|
||||||
2
Assets/02_Scripts/Data/Communication/VoiceClip.cs.meta
Normal file
2
Assets/02_Scripts/Data/Communication/VoiceClip.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 56b64eb84b3a1a44fa7fff7ae5e932d0
|
||||||
Reference in New Issue
Block a user