From f14524833fb9400f411e7a1ff04ff3c0d9ff9f5c Mon Sep 17 00:00:00 2001 From: B-DeshiDev Date: Fri, 7 Jun 2024 11:33:40 +0600 Subject: [PATCH] Find nodes without characterData --- .../Data/LineSpeakerDataPropertyDrawer.cs | 5 ++ .../Runtime/Data/xNode/Graph/DialogueGraph.cs | 22 +++++- .../Graphs/Dialogue Graph 1.asset | 67 ++++++++++++++----- .../package.json | 2 +- 4 files changed, 76 insertions(+), 20 deletions(-) diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/LineSpeakerDataPropertyDrawer.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/LineSpeakerDataPropertyDrawer.cs index bec2d14..e0b981b 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/LineSpeakerDataPropertyDrawer.cs +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Editor/Data/LineSpeakerDataPropertyDrawer.cs @@ -69,6 +69,11 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten EditorGUI.EndDisabledGroup(); } } + else + { + position.y += EditorGUIUtility.singleLineHeight; + EditorGUI.HelpBox(position, "NO CharacterData", MessageType.Error); + } // Set indent back to what it was EditorGUI.indentLevel = indent; diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Graph/DialogueGraph.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Graph/DialogueGraph.cs index 731524e..890768e 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Graph/DialogueGraph.cs +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Graph/DialogueGraph.cs @@ -8,7 +8,8 @@ namespace Studio23.SS2.DialogueSystem.Data { - [CreateAssetMenu(menuName = "Studio-23/Dialogue System/New Dialogue Graph", fileName ="Dialogue Graph")] + [CreateAssetMenu(menuName = "Studio-23/Dialogue System/New Dial" + + "ogue Graph", fileName ="Dialogue Graph")] public class DialogueGraph : NodeGraph { public bool SkippableDialogue; @@ -144,5 +145,24 @@ private DialogueStartNode FindStartNode() return null; } + [ContextMenu("FindNodesWithoutCharacterData")] + public void FindNodesWithoutCharacterData() + { + foreach (var node in nodes) + { + if (node is DialogueLineNodeBase lineNode) + { + if (lineNode.SpeakerData?.Character == null) + { + Debug.LogWarning($"{lineNode} has no characterData", lineNode); + } + else + { + + } + } + } + } + } } \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Graphs/Dialogue Graph 1.asset b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Graphs/Dialogue Graph 1.asset index 84fce9a..9780cb3 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Graphs/Dialogue Graph 1.asset +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/Graphs/Dialogue Graph 1.asset @@ -62,8 +62,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -142,8 +143,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -210,8 +212,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -347,8 +350,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -413,8 +417,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -481,8 +486,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -507,6 +513,7 @@ MonoBehaviour: ports: keys: - Exit + - Events values: - _fieldName: Exit _node: {fileID: -1822135301059774123} @@ -520,7 +527,17 @@ MonoBehaviour: _connectionType: 1 _typeConstraint: 2 _dynamic: 0 + - _fieldName: Events + _node: {fileID: -1822135301059774123} + _typeQualifiedName: Studio23.SS2.DialogueSystem.Data.EventNodeBase, com.studio23.ss2.dialoguesystem, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + connections: [] + _direction: 1 + _connectionType: 0 + _typeConstraint: 3 + _dynamic: 0 Exit: {fileID: 0} + Events: {fileID: 0} --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 @@ -637,8 +654,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -730,6 +748,7 @@ MonoBehaviour: ports: keys: - Exit + - Events values: - _fieldName: Exit _node: {fileID: 4547693736577939076} @@ -743,7 +762,17 @@ MonoBehaviour: _connectionType: 1 _typeConstraint: 2 _dynamic: 0 + - _fieldName: Events + _node: {fileID: 4547693736577939076} + _typeQualifiedName: Studio23.SS2.DialogueSystem.Data.EventNodeBase, com.studio23.ss2.dialoguesystem, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + connections: [] + _direction: 1 + _connectionType: 0 + _typeConstraint: 3 + _dynamic: 0 Exit: {fileID: 0} + Events: {fileID: 0} --- !u!114 &5124243875242287576 MonoBehaviour: m_ObjectHideFlags: 0 @@ -803,8 +832,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} @@ -877,8 +907,9 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] - ID: - Reaction: + SpeakerData: + Character: {fileID: 0} + Expression: {fileID: 0} FMODEvent: Exit: {fileID: 0} Events: {fileID: 0} diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json b/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json index 4280793..474b078 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json @@ -1,6 +1,6 @@ { "name": "com.studio23.ss2.dialoguesystem", - "version": "0.4.12", + "version": "0.4.13", "displayName": "Dialogue System", "description": "Dialogue system is an authoring tool for developers to integrate dialogue from scriptwriters inside unity.", "unity": "2022.3",