diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/DialogueLineNodeBase.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/DialogueLineNodeBase.cs index 4ada38d..e2f9394 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/DialogueLineNodeBase.cs +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/DialogueLineNodeBase.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Cysharp.Threading.Tasks; +using Studio23.SS2.DialogueSystem.Utility; using UnityEngine; using UnityEngine.Localization; using UnityEngine.Serialization; @@ -20,7 +21,7 @@ public abstract class DialogueLineNodeBase : DialogueNodeBase private bool _canAdvanceDialogue; - [Output(dynamicPortList =true)] + [Output()] public int Events; public override void HandleDialogueAdvance() @@ -36,9 +37,8 @@ public virtual void InvokePostPlayEvents() var eventNodeConnection = eventNodePort.GetConnection(i); if (eventNodeConnection != null) { - if (eventNodeConnection.node is EventNode eventNode) + if (eventNodeConnection.node is EventNodeBase eventNode) { - Debug.Log($"Invoke event {eventNode} on {this}", this); eventNode.Invoke(); } else diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/EventNode.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/EventNode.cs index 0fe51a3..2540acf 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/EventNode.cs +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/EventNode.cs @@ -1,24 +1,19 @@ using UnityEngine; using UnityEngine.Events; +using UnityEngine.Serialization; using XNode; namespace Studio23.SS2.DialogueSystem.Data { - [NodeTint(200,50,50), NodeWidth(500)] - public class EventNode : DialogueGraphNodeBase + [NodeTint(200,50,50), NodeWidth(500), CreateNodeMenu("Unity Event Node")] + public class EventNode : EventNodeBase { - [Input] - public int Entry; + public UnityEvent Event; - [SerializeField] UnityEvent Event; - - public void Invoke() + public override void Invoke() { Event.Invoke(); } - public override void Initialize() - { - //do nothing - } + } } diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/EventNodeBase.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/EventNodeBase.cs new file mode 100644 index 0000000..dd15590 --- /dev/null +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/EventNodeBase.cs @@ -0,0 +1,15 @@ +namespace Studio23.SS2.DialogueSystem.Data +{ + public abstract class EventNodeBase : DialogueGraphNodeBase + { + [Input] + public int Entry; + + public abstract void Invoke(); + + public override void Initialize() + { + //do nothing + } + } +} \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/EventNodeBase.cs.meta b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/EventNodeBase.cs.meta new file mode 100644 index 0000000..6f9b272 --- /dev/null +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Runtime/Data/xNode/Node/EventNodeBase.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: abfa617c4d0d4994959c3586b60068b4 +timeCreated: 1706246003 \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Configuration/SubtitleSettings.asset b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Configuration/SubtitleSettings.asset new file mode 100644 index 0000000..2c235fa --- /dev/null +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Configuration/SubtitleSettings.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 846559197231ca24c8ee20e824e62423, type: 3} + m_Name: SubtitleSettings + m_EditorClassIdentifier: + SubtitleColor: {r: 0, g: 0, b: 0, a: 1} + SubtitleFontSize: 25 + DropShadow: 0 + EnableCharacterColor: 1 + ShowBackground: 0 + BackGroundColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Configuration/SubtitleSettings.asset.meta b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Configuration/SubtitleSettings.asset.meta new file mode 100644 index 0000000..4c62a21 --- /dev/null +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Configuration/SubtitleSettings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2984fcedb51c3614cbb95f385ebe07b7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/DialogueChoiceUI.cs b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/DialogueChoiceUI.cs index ac1ce66..646cbfd 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/DialogueChoiceUI.cs +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/DialogueChoiceUI.cs @@ -87,7 +87,6 @@ private void NukeButtons() { for (int i = 0; i < _spawnedButtons.Count; i++) { - Debug.Log(_spawnedButtons[i].gameObject); Destroy(_spawnedButtons[i].gameObject); } _spawnedButtons.Clear(); diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Prefabs/DialogueChoiceButton.prefab b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Prefabs/DialogueChoiceButton.prefab index a5f4517..6081fea 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Prefabs/DialogueChoiceButton.prefab +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Prefabs/DialogueChoiceButton.prefab @@ -185,11 +185,11 @@ MonoBehaviour: m_GameObject: {fileID: 710383144915376259} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0d7ad9dc974fe9f47a9f4913e7ed1959, type: 3} + m_Script: {fileID: 11500000, guid: 7e40592e2649edc4a9608e4bcedd13b6, type: 3} m_Name: m_EditorClassIdentifier: - tmpTarget: {fileID: 2068565476251727824} - localizer: {fileID: 2515288861120483222} + _tmpTarget: {fileID: 2068565476251727824} + _localizer: {fileID: 2515288861120483222} --- !u!1 &1051075638931329264 GameObject: m_ObjectHideFlags: 0 @@ -247,7 +247,7 @@ MonoBehaviour: m_GameObject: {fileID: 1051075638931329264} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3653584ea3e848548b1e9b4ccec48038, type: 3} + m_Script: {fileID: 11500000, guid: caff724c412515940af59af3cd166437, type: 3} m_Name: m_EditorClassIdentifier: _button: {fileID: 855239014452063087} diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/CharacterTable.asset b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/CharacterTable.asset index 768dfa1..255bf37 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/CharacterTable.asset +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Resources/DialogueSystem/CharacterTable.asset @@ -12,8 +12,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 266137c0ba2af9d4aa901f763389f2dd, type: 3} m_Name: CharacterTable m_EditorClassIdentifier: - characterList: - - {fileID: 11400000, guid: 4f969d28d1c102a4bacf435c205ed56b, type: 2} - - {fileID: 11400000, guid: 5d86b03e6edb37644bab0698454ad100, type: 2} - - {fileID: 11400000, guid: 017db39c22263f4449b8084d117b6f77, type: 2} - - {fileID: 11400000, guid: 2d478784f5507e24598d112f29849808, type: 2} + characterList: [] 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 c289047..226ec7a 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 @@ -306,6 +306,7 @@ MonoBehaviour: keys: - Entry - Exit + - Events 0 - Events values: - _fieldName: Entry @@ -332,6 +333,15 @@ MonoBehaviour: _connectionType: 0 _typeConstraint: 0 _dynamic: 0 + - _fieldName: Events 0 + _node: {fileID: -2976715106930901999} + _typeQualifiedName: System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + connections: [] + _direction: 1 + _connectionType: 0 + _typeConstraint: 0 + _dynamic: 1 - _fieldName: Events _node: {fileID: -2976715106930901999} _typeQualifiedName: System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, @@ -376,8 +386,8 @@ MonoBehaviour: ports: keys: - Exit - - Events - Events 0 + - Events values: - _fieldName: Exit _node: {fileID: -1822135301059774123} @@ -391,7 +401,7 @@ MonoBehaviour: _connectionType: 0 _typeConstraint: 0 _dynamic: 0 - - _fieldName: Events + - _fieldName: Events 0 _node: {fileID: -1822135301059774123} _typeQualifiedName: System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -399,19 +409,16 @@ MonoBehaviour: _direction: 1 _connectionType: 0 _typeConstraint: 0 - _dynamic: 0 - - _fieldName: Events 0 + _dynamic: 1 + - _fieldName: Events _node: {fileID: -1822135301059774123} _typeQualifiedName: System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - connections: - - fieldName: Entry - node: {fileID: 5592580153945411639} - reroutePoints: [] + connections: [] _direction: 1 _connectionType: 0 _typeConstraint: 0 - _dynamic: 1 + _dynamic: 0 DialogueLocalizedString: m_TableReference: m_TableCollectionName: GUID:2fefaa175576a0e48bf5b28cb5260137 @@ -453,7 +460,7 @@ MonoBehaviour: - {fileID: 1247732052999767825} - {fileID: 7322660833987517088} - {fileID: -2988117806070830359} - - {fileID: 5592580153945411639} + - {fileID: 401710227361937087} SkippableDialogue: 0 _startNode: {fileID: -1822135301059774123} _conditions: [] @@ -618,40 +625,6 @@ MonoBehaviour: references: version: 2 RefIds: [] ---- !u!114 &5592580153945411639 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 15f374202db79ae42ac267b0047a95ef, type: 3} - m_Name: Event - m_EditorClassIdentifier: - graph: {fileID: 11400000} - position: {x: -1960, y: 440} - ports: - keys: - - Entry - values: - - _fieldName: Entry - _node: {fileID: 5592580153945411639} - _typeQualifiedName: System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, - PublicKeyToken=b77a5c561934e089 - connections: - - fieldName: Events 0 - node: {fileID: -1822135301059774123} - reroutePoints: [] - _direction: 0 - _connectionType: 0 - _typeConstraint: 0 - _dynamic: 0 - Entry: 0 - Event: - m_PersistentCalls: - m_Calls: [] --- !u!114 &7322660833987517088 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Scene/SampleScene.unity b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Scene/SampleScene.unity index 57efd34..146b37f 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Scene/SampleScene.unity +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/Samples/DialogueChoiceDemo/Scene/SampleScene.unity @@ -353,7 +353,7 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 2 - m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0} + m_BackGroundColor: {r: 0.4811321, g: 0.4811321, b: 0.4811321, a: 0} m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 @@ -983,9 +983,13 @@ MonoBehaviour: m_GameObject: {fileID: 1344663831} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c008de1dc3854a46936dcfdfb971d6e8, type: 3} + m_Script: {fileID: 11500000, guid: de5cbd887ed5dbc4781a4aaa98b90fe9, type: 3} m_Name: m_EditorClassIdentifier: + _sortedChoices: [] + _buttonContainer: {fileID: 1126433870} + _buttonPrefab: {fileID: 8035196018851654212, guid: af9bf8cc40254224d85a2c9c750ce48a, type: 3} + _spawnedButtons: [] --- !u!1 &1456424668 GameObject: m_ObjectHideFlags: 0 @@ -1043,9 +1047,15 @@ MonoBehaviour: m_GameObject: {fileID: 1456424668} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fc09cb0cd50138a4797efe998aeea794, type: 3} + m_Script: {fileID: 11500000, guid: 39891d0bfdc636f4b9a2c7baa8b8f148, type: 3} m_Name: m_EditorClassIdentifier: + DialogueTMP: {fileID: 1838186516} + TextLocalizer: {fileID: 1838186517} + BackgroundImage: {fileID: 381729576} + UIRoot: {fileID: 1456424668} + CharacterTable: {fileID: 11400000, guid: d475c9e2546e17e4bb37441da01467e0, type: 2} + _config: {fileID: 11400000, guid: 2984fcedb51c3614cbb95f385ebe07b7, type: 2} --- !u!1 &1813981465 GameObject: m_ObjectHideFlags: 0 @@ -1259,9 +1269,11 @@ MonoBehaviour: m_GameObject: {fileID: 1838186513} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0d7ad9dc974fe9f47a9f4913e7ed1959, type: 3} + m_Script: {fileID: 11500000, guid: 7e40592e2649edc4a9608e4bcedd13b6, type: 3} m_Name: m_EditorClassIdentifier: + _tmpTarget: {fileID: 1838186516} + _localizer: {fileID: 1838186518} --- !u!114 &1838186518 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json b/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json index d1dc45e..68ebf8a 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.3.5", + "version": "0.3.6", "displayName": "Dialogue System", "description": "Dialogue system is an authoring tool for developers to integrate dialogue from scriptwriters inside unity.", "unity": "2022.3", diff --git a/ProjectSettings/EditorSettings.asset b/ProjectSettings/EditorSettings.asset index 6789e4e..22a423d 100644 --- a/ProjectSettings/EditorSettings.asset +++ b/ProjectSettings/EditorSettings.asset @@ -24,7 +24,7 @@ EditorSettings: m_EnableEditorAsyncCPUTextureLoading: 0 m_AsyncShaderCompilation: 1 m_PrefabModeAllowAutoSave: 1 - m_EnterPlayModeOptionsEnabled: 1 + m_EnterPlayModeOptionsEnabled: 0 m_EnterPlayModeOptions: 3 m_GameObjectNamingDigits: 1 m_GameObjectNamingScheme: 0