Introduced dialogue graph magic, created assest and importers. Added events for broadcasting puzzle steps
This commit is contained in:
8
Assets/Dialogue.meta
Normal file
8
Assets/Dialogue.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: dcec43b1a5d809b4187eb91cabd6b657
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
695
Assets/Dialogue/TestDialogue.dialoguegraph
Normal file
695
Assets/Dialogue/TestDialogue.dialoguegraph
Normal file
@@ -0,0 +1,695 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &1
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 61
|
||||||
|
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: 790b4d75d92f4b0984310a268dbd952f, type: 3}
|
||||||
|
m_Name: TestDialogue
|
||||||
|
m_EditorClassIdentifier: Unity.GraphToolkit.Editor::Unity.GraphToolkit.Editor.Implementation.GraphObjectImp
|
||||||
|
m_GraphModel:
|
||||||
|
rid: 1219994508087787734
|
||||||
|
references:
|
||||||
|
version: 2
|
||||||
|
RefIds:
|
||||||
|
- rid: -2
|
||||||
|
type: {class: , ns: , asm: }
|
||||||
|
- rid: 1219994508087787734
|
||||||
|
type: {class: GraphModelImp, ns: Unity.GraphToolkit.Editor.Implementation, asm: Unity.GraphToolkit.Editor}
|
||||||
|
data:
|
||||||
|
m_Guid:
|
||||||
|
m_Value0: 12720528336768607292
|
||||||
|
m_Value1: 4541789886294233460
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 3c246244206588b074910791d6ad073f
|
||||||
|
m_Name:
|
||||||
|
m_GraphNodeModels:
|
||||||
|
- rid: 1219994508087787747
|
||||||
|
- rid: 1219994508087787749
|
||||||
|
- rid: 1219994508087787751
|
||||||
|
- rid: 1219994508087787764
|
||||||
|
- rid: 1219994508087787770
|
||||||
|
- rid: 1219994508087787776
|
||||||
|
m_GraphWireModels:
|
||||||
|
- rid: 1219994508087787755
|
||||||
|
- rid: 1219994508087787773
|
||||||
|
- rid: 1219994508087787779
|
||||||
|
- rid: 1219994508087787780
|
||||||
|
- rid: 1219994508087787813
|
||||||
|
m_GraphStickyNoteModels: []
|
||||||
|
m_GraphPlacematModels: []
|
||||||
|
m_GraphVariableModels:
|
||||||
|
- rid: 1219994508087787760
|
||||||
|
m_GraphPortalModels: []
|
||||||
|
m_SectionModels:
|
||||||
|
- rid: 1219994508087787735
|
||||||
|
m_LocalSubgraphs: []
|
||||||
|
m_LastKnownBounds:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 123
|
||||||
|
y: -65
|
||||||
|
width: 1698
|
||||||
|
height: 242
|
||||||
|
m_GraphElementMetaData:
|
||||||
|
- m_Guid:
|
||||||
|
m_Value0: 13346176596883742728
|
||||||
|
m_Value1: 18083586785705260694
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 0820e35ee72437b996f6e8e25ecef5fa
|
||||||
|
m_Category: 0
|
||||||
|
m_Index: 0
|
||||||
|
- m_Guid:
|
||||||
|
m_Value0: 356371523793864382
|
||||||
|
m_Value1: 4751895819492649258
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: be46cc430316f2042ae9853a1220f241
|
||||||
|
m_Category: 0
|
||||||
|
m_Index: 1
|
||||||
|
- m_Guid:
|
||||||
|
m_Value0: 8593691416048532199
|
||||||
|
m_Value1: 6890539440515769320
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: e77ae5c2cfec4277e8e3c20e1d1da05f
|
||||||
|
m_Category: 0
|
||||||
|
m_Index: 2
|
||||||
|
- m_Guid:
|
||||||
|
m_Value0: 7709580528075638554
|
||||||
|
m_Value1: 12466507236153719696
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 1a8737a7a4eefd6a907bc7e847ee01ad
|
||||||
|
m_Category: 2
|
||||||
|
m_Index: 0
|
||||||
|
- m_Guid:
|
||||||
|
m_Value0: 13887651235662800591
|
||||||
|
m_Value1: 935957084791214113
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: cf26320a38d9bac02190fd7b0230fd0c
|
||||||
|
m_Category: 1
|
||||||
|
m_Index: 0
|
||||||
|
- m_Guid:
|
||||||
|
m_Value0: 4225538081375705477
|
||||||
|
m_Value1: 10816025756629798206
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 85d948457f20a43a3e0d65b11e3e1a96
|
||||||
|
m_Category: 0
|
||||||
|
m_Index: 3
|
||||||
|
- m_Guid:
|
||||||
|
m_Value0: 1990642935411556156
|
||||||
|
m_Value1: 16710028644464764280
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 3cbfd8ef332fa01b78a5ecc384f2e5e7
|
||||||
|
m_Category: 0
|
||||||
|
m_Index: 4
|
||||||
|
- m_Guid:
|
||||||
|
m_Value0: 5477022009621441144
|
||||||
|
m_Value1: 13992127810305260154
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 786a7bce7f4a024c7afa1b291c062ec2
|
||||||
|
m_Category: 2
|
||||||
|
m_Index: 1
|
||||||
|
- m_Guid:
|
||||||
|
m_Value0: 10537482371379217669
|
||||||
|
m_Value1: 805153394380735108
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 05c5ff0463a83c928482c30dbf7a2c0b
|
||||||
|
m_Category: 0
|
||||||
|
m_Index: 5
|
||||||
|
- m_Guid:
|
||||||
|
m_Value0: 10238952115911916765
|
||||||
|
m_Value1: 16796494752743159762
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: ddfc297db310188ed2f7f768fc2219e9
|
||||||
|
m_Category: 2
|
||||||
|
m_Index: 2
|
||||||
|
- m_Guid:
|
||||||
|
m_Value0: 10375816761084646535
|
||||||
|
m_Value1: 15824079162718769611
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 8794feea5e4efe8fcb5183af286c9adb
|
||||||
|
m_Category: 2
|
||||||
|
m_Index: 3
|
||||||
|
- m_Guid:
|
||||||
|
m_Value0: 10491986159911335451
|
||||||
|
m_Value1: 18287880145942505208
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 1b76d4d1d2059b91f866d271199acbfd
|
||||||
|
m_Category: 2
|
||||||
|
m_Index: 4
|
||||||
|
m_EntryPoint:
|
||||||
|
rid: 1219994508087787747
|
||||||
|
m_Graph:
|
||||||
|
rid: 1219994508087787736
|
||||||
|
- rid: 1219994508087787735
|
||||||
|
type: {class: SectionModel, ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Guid:
|
||||||
|
m_Value0: 12939578175715148634
|
||||||
|
m_Value1: 2855330721591447007
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 5a03e642cb9d92b3dfcdb7c0292ca027
|
||||||
|
m_Version: 2
|
||||||
|
m_Items:
|
||||||
|
- rid: 1219994508087787760
|
||||||
|
m_Title:
|
||||||
|
- rid: 1219994508087787736
|
||||||
|
type: {class: DialogueGraph, ns: Editor.Dialogue, asm: AppleHillsEditor}
|
||||||
|
data:
|
||||||
|
- rid: 1219994508087787747
|
||||||
|
type: {class: UserNodeModelImp, ns: Unity.GraphToolkit.Editor.Implementation, asm: Unity.GraphToolkit.Editor}
|
||||||
|
data:
|
||||||
|
m_Guid:
|
||||||
|
m_Value0: 13346176596883742728
|
||||||
|
m_Value1: 18083586785705260694
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 0820e35ee72437b996f6e8e25ecef5fa
|
||||||
|
m_Version: 2
|
||||||
|
m_Position: {x: 316.4595, y: -65.01193}
|
||||||
|
m_Title:
|
||||||
|
m_Tooltip:
|
||||||
|
m_NodePreviewModel:
|
||||||
|
rid: -2
|
||||||
|
m_State: 0
|
||||||
|
m_InputConstantsById:
|
||||||
|
m_KeyList:
|
||||||
|
- SpeakerName
|
||||||
|
m_ValueList:
|
||||||
|
- rid: 1219994508087787766
|
||||||
|
m_InputPortInfos:
|
||||||
|
expandedPortsById:
|
||||||
|
m_KeyList: []
|
||||||
|
m_ValueList:
|
||||||
|
m_OutputPortInfos:
|
||||||
|
expandedPortsById:
|
||||||
|
m_KeyList: []
|
||||||
|
m_ValueList:
|
||||||
|
m_Collapsed: 0
|
||||||
|
m_CurrentModeIndex: 0
|
||||||
|
m_ElementColor:
|
||||||
|
m_Color: {r: 0, g: 0, b: 0, a: 0}
|
||||||
|
m_HasUserColor: 0
|
||||||
|
m_Node:
|
||||||
|
rid: 1219994508087787748
|
||||||
|
- rid: 1219994508087787748
|
||||||
|
type: {class: StartNode, ns: Editor.Dialogue, asm: AppleHillsEditor}
|
||||||
|
data:
|
||||||
|
- rid: 1219994508087787749
|
||||||
|
type: {class: UserNodeModelImp, ns: Unity.GraphToolkit.Editor.Implementation, asm: Unity.GraphToolkit.Editor}
|
||||||
|
data:
|
||||||
|
m_Guid:
|
||||||
|
m_Value0: 356371523793864382
|
||||||
|
m_Value1: 4751895819492649258
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: be46cc430316f2042ae9853a1220f241
|
||||||
|
m_Version: 2
|
||||||
|
m_Position: {x: 1707.9503, y: -59.602116}
|
||||||
|
m_Title:
|
||||||
|
m_Tooltip:
|
||||||
|
m_NodePreviewModel:
|
||||||
|
rid: -2
|
||||||
|
m_State: 0
|
||||||
|
m_InputConstantsById:
|
||||||
|
m_KeyList: []
|
||||||
|
m_ValueList: []
|
||||||
|
m_InputPortInfos:
|
||||||
|
expandedPortsById:
|
||||||
|
m_KeyList: []
|
||||||
|
m_ValueList:
|
||||||
|
m_OutputPortInfos:
|
||||||
|
expandedPortsById:
|
||||||
|
m_KeyList: []
|
||||||
|
m_ValueList:
|
||||||
|
m_Collapsed: 0
|
||||||
|
m_CurrentModeIndex: 0
|
||||||
|
m_ElementColor:
|
||||||
|
m_Color: {r: 0, g: 0, b: 0, a: 0}
|
||||||
|
m_HasUserColor: 0
|
||||||
|
m_Node:
|
||||||
|
rid: 1219994508087787750
|
||||||
|
- rid: 1219994508087787750
|
||||||
|
type: {class: EndNode, ns: Editor.Dialogue, asm: AppleHillsEditor}
|
||||||
|
data:
|
||||||
|
- rid: 1219994508087787751
|
||||||
|
type: {class: UserNodeModelImp, ns: Unity.GraphToolkit.Editor.Implementation, asm: Unity.GraphToolkit.Editor}
|
||||||
|
data:
|
||||||
|
m_Guid:
|
||||||
|
m_Value0: 8593691416048532199
|
||||||
|
m_Value1: 6890539440515769320
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: e77ae5c2cfec4277e8e3c20e1d1da05f
|
||||||
|
m_Version: 2
|
||||||
|
m_Position: {x: 530.97986, y: -60.683594}
|
||||||
|
m_Title:
|
||||||
|
m_Tooltip:
|
||||||
|
m_NodePreviewModel:
|
||||||
|
rid: -2
|
||||||
|
m_State: 0
|
||||||
|
m_InputConstantsById:
|
||||||
|
m_KeyList:
|
||||||
|
- __option_DialogueLineType
|
||||||
|
- __option_NoLines
|
||||||
|
- DefaultDialogueLine
|
||||||
|
- LoopThroughDefaultLines
|
||||||
|
m_ValueList:
|
||||||
|
- rid: 1219994508087787857
|
||||||
|
- rid: 1219994508087787858
|
||||||
|
- rid: 1219994508087787897
|
||||||
|
- rid: 1219994508087787904
|
||||||
|
m_InputPortInfos:
|
||||||
|
expandedPortsById:
|
||||||
|
m_KeyList: []
|
||||||
|
m_ValueList:
|
||||||
|
m_OutputPortInfos:
|
||||||
|
expandedPortsById:
|
||||||
|
m_KeyList: []
|
||||||
|
m_ValueList:
|
||||||
|
m_Collapsed: 0
|
||||||
|
m_CurrentModeIndex: 0
|
||||||
|
m_ElementColor:
|
||||||
|
m_Color: {r: 0, g: 0, b: 0, a: 0}
|
||||||
|
m_HasUserColor: 0
|
||||||
|
m_Node:
|
||||||
|
rid: 1219994508087787752
|
||||||
|
- rid: 1219994508087787752
|
||||||
|
type: {class: DialogueNode, ns: Editor.Dialogue, asm: AppleHillsEditor}
|
||||||
|
data:
|
||||||
|
- rid: 1219994508087787755
|
||||||
|
type: {class: WireModel, ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Guid:
|
||||||
|
m_Value0: 7709580528075638554
|
||||||
|
m_Value1: 12466507236153719696
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 1a8737a7a4eefd6a907bc7e847ee01ad
|
||||||
|
m_Version: 2
|
||||||
|
m_FromPortReference:
|
||||||
|
m_NodeModelGuid:
|
||||||
|
m_Value0: 13346176596883742728
|
||||||
|
m_Value1: 18083586785705260694
|
||||||
|
m_NodeModelHashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 0820e35ee72437b996f6e8e25ecef5fa
|
||||||
|
m_UniqueId: out
|
||||||
|
m_PortDirection: 2
|
||||||
|
m_PortOrientation: 0
|
||||||
|
m_Title: out
|
||||||
|
m_ToPortReference:
|
||||||
|
m_NodeModelGuid:
|
||||||
|
m_Value0: 8593691416048532199
|
||||||
|
m_Value1: 6890539440515769320
|
||||||
|
m_NodeModelHashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: e77ae5c2cfec4277e8e3c20e1d1da05f
|
||||||
|
m_UniqueId: in
|
||||||
|
m_PortDirection: 1
|
||||||
|
m_PortOrientation: 0
|
||||||
|
m_Title: in
|
||||||
|
- rid: 1219994508087787760
|
||||||
|
type: {class: VariableDeclarationModel, ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Guid:
|
||||||
|
m_Value0: 13887651235662800591
|
||||||
|
m_Value1: 935957084791214113
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: cf26320a38d9bac02190fd7b0230fd0c
|
||||||
|
m_Version: 2
|
||||||
|
m_Name: Anna-Lyse
|
||||||
|
m_UniqueId:
|
||||||
|
m_DataType:
|
||||||
|
m_Identification: System.String, System.Private.CoreLib, Version=4.0.0.0,
|
||||||
|
Culture=neutral, PublicKeyToken=b77a5c561934e089
|
||||||
|
m_IsExposed: 0
|
||||||
|
m_Scope: 0
|
||||||
|
m_ShowOnInspectorOnly: 0
|
||||||
|
m_Tooltip:
|
||||||
|
m_InitializationValue:
|
||||||
|
rid: 1219994508087787761
|
||||||
|
m_Modifiers: 0
|
||||||
|
m_VariableFlags: 0
|
||||||
|
- rid: 1219994508087787761
|
||||||
|
type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value: Anna-Lyse
|
||||||
|
- rid: 1219994508087787764
|
||||||
|
type: {class: VariableNodeModelImp, ns: Unity.GraphToolkit.Editor.Implementation, asm: Unity.GraphToolkit.Editor}
|
||||||
|
data:
|
||||||
|
m_Guid:
|
||||||
|
m_Value0: 4225538081375705477
|
||||||
|
m_Value1: 10816025756629798206
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 85d948457f20a43a3e0d65b11e3e1a96
|
||||||
|
m_Version: 2
|
||||||
|
m_Position: {x: 123.485, y: -64.61}
|
||||||
|
m_Title: Anna-Lyse
|
||||||
|
m_Tooltip:
|
||||||
|
m_NodePreviewModel:
|
||||||
|
rid: -2
|
||||||
|
m_State: 0
|
||||||
|
m_InputConstantsById:
|
||||||
|
m_KeyList: []
|
||||||
|
m_ValueList: []
|
||||||
|
m_InputPortInfos:
|
||||||
|
expandedPortsById:
|
||||||
|
m_KeyList: []
|
||||||
|
m_ValueList:
|
||||||
|
m_OutputPortInfos:
|
||||||
|
expandedPortsById:
|
||||||
|
m_KeyList: []
|
||||||
|
m_ValueList:
|
||||||
|
m_Collapsed: 0
|
||||||
|
m_CurrentModeIndex: 0
|
||||||
|
m_ElementColor:
|
||||||
|
m_Color: {r: 0, g: 0, b: 0, a: 0}
|
||||||
|
m_HasUserColor: 0
|
||||||
|
m_DeclarationModel:
|
||||||
|
rid: 1219994508087787760
|
||||||
|
m_DeclarationModelHashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: cf26320a38d9bac02190fd7b0230fd0c
|
||||||
|
- rid: 1219994508087787766
|
||||||
|
type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value:
|
||||||
|
- rid: 1219994508087787770
|
||||||
|
type: {class: UserNodeModelImp, ns: Unity.GraphToolkit.Editor.Implementation, asm: Unity.GraphToolkit.Editor}
|
||||||
|
data:
|
||||||
|
m_Guid:
|
||||||
|
m_Value0: 1990642935411556156
|
||||||
|
m_Value1: 16710028644464764280
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 3cbfd8ef332fa01b78a5ecc384f2e5e7
|
||||||
|
m_Version: 2
|
||||||
|
m_Position: {x: 905.0175, y: -60.677498}
|
||||||
|
m_Title: DialogueNode
|
||||||
|
m_Tooltip:
|
||||||
|
m_NodePreviewModel:
|
||||||
|
rid: -2
|
||||||
|
m_State: 0
|
||||||
|
m_InputConstantsById:
|
||||||
|
m_KeyList:
|
||||||
|
- __option_DialogueLineType
|
||||||
|
- __option_NoLines
|
||||||
|
- DefaultDialogueLine1
|
||||||
|
- DefaultDialogueLine2
|
||||||
|
- DefaultDialogueLine3
|
||||||
|
- LoopThroughDefaultLines
|
||||||
|
m_ValueList:
|
||||||
|
- rid: 1219994508087787860
|
||||||
|
- rid: 1219994508087787861
|
||||||
|
- rid: 1219994508087787900
|
||||||
|
- rid: 1219994508087787901
|
||||||
|
- rid: 1219994508087787902
|
||||||
|
- rid: 1219994508087787905
|
||||||
|
m_InputPortInfos:
|
||||||
|
expandedPortsById:
|
||||||
|
m_KeyList: []
|
||||||
|
m_ValueList:
|
||||||
|
m_OutputPortInfos:
|
||||||
|
expandedPortsById:
|
||||||
|
m_KeyList: []
|
||||||
|
m_ValueList:
|
||||||
|
m_Collapsed: 0
|
||||||
|
m_CurrentModeIndex: 0
|
||||||
|
m_ElementColor:
|
||||||
|
m_Color: {r: 0, g: 0, b: 0, a: 0}
|
||||||
|
m_HasUserColor: 0
|
||||||
|
m_Node:
|
||||||
|
rid: 1219994508087787772
|
||||||
|
- rid: 1219994508087787772
|
||||||
|
type: {class: DialogueNode, ns: Editor.Dialogue, asm: AppleHillsEditor}
|
||||||
|
data:
|
||||||
|
- rid: 1219994508087787773
|
||||||
|
type: {class: WireModel, ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Guid:
|
||||||
|
m_Value0: 5477022009621441144
|
||||||
|
m_Value1: 13992127810305260154
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 786a7bce7f4a024c7afa1b291c062ec2
|
||||||
|
m_Version: 2
|
||||||
|
m_FromPortReference:
|
||||||
|
m_NodeModelGuid:
|
||||||
|
m_Value0: 8593691416048532199
|
||||||
|
m_Value1: 6890539440515769320
|
||||||
|
m_NodeModelHashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: e77ae5c2cfec4277e8e3c20e1d1da05f
|
||||||
|
m_UniqueId: out
|
||||||
|
m_PortDirection: 2
|
||||||
|
m_PortOrientation: 0
|
||||||
|
m_Title: out
|
||||||
|
m_ToPortReference:
|
||||||
|
m_NodeModelGuid:
|
||||||
|
m_Value0: 1990642935411556156
|
||||||
|
m_Value1: 16710028644464764280
|
||||||
|
m_NodeModelHashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 3cbfd8ef332fa01b78a5ecc384f2e5e7
|
||||||
|
m_UniqueId: in
|
||||||
|
m_PortDirection: 1
|
||||||
|
m_PortOrientation: 0
|
||||||
|
m_Title: in
|
||||||
|
- rid: 1219994508087787776
|
||||||
|
type: {class: UserNodeModelImp, ns: Unity.GraphToolkit.Editor.Implementation, asm: Unity.GraphToolkit.Editor}
|
||||||
|
data:
|
||||||
|
m_Guid:
|
||||||
|
m_Value0: 10537482371379217669
|
||||||
|
m_Value1: 805153394380735108
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 05c5ff0463a83c928482c30dbf7a2c0b
|
||||||
|
m_Version: 2
|
||||||
|
m_Position: {x: 1294.008, y: -60.75061}
|
||||||
|
m_Title: DialogueNode
|
||||||
|
m_Tooltip:
|
||||||
|
m_NodePreviewModel:
|
||||||
|
rid: -2
|
||||||
|
m_State: 0
|
||||||
|
m_InputConstantsById:
|
||||||
|
m_KeyList:
|
||||||
|
- __option_DialogueLineType
|
||||||
|
- __option_NoLines
|
||||||
|
- DefaultDialogueLine
|
||||||
|
- LoopThroughDefaultLines
|
||||||
|
m_ValueList:
|
||||||
|
- rid: 1219994508087787863
|
||||||
|
- rid: 1219994508087787864
|
||||||
|
- rid: 1219994508087787898
|
||||||
|
- rid: 1219994508087787906
|
||||||
|
m_InputPortInfos:
|
||||||
|
expandedPortsById:
|
||||||
|
m_KeyList: []
|
||||||
|
m_ValueList:
|
||||||
|
m_OutputPortInfos:
|
||||||
|
expandedPortsById:
|
||||||
|
m_KeyList: []
|
||||||
|
m_ValueList:
|
||||||
|
m_Collapsed: 0
|
||||||
|
m_CurrentModeIndex: 0
|
||||||
|
m_ElementColor:
|
||||||
|
m_Color: {r: 0, g: 0, b: 0, a: 0}
|
||||||
|
m_HasUserColor: 0
|
||||||
|
m_Node:
|
||||||
|
rid: 1219994508087787778
|
||||||
|
- rid: 1219994508087787778
|
||||||
|
type: {class: DialogueNode, ns: Editor.Dialogue, asm: AppleHillsEditor}
|
||||||
|
data:
|
||||||
|
- rid: 1219994508087787779
|
||||||
|
type: {class: WireModel, ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Guid:
|
||||||
|
m_Value0: 10238952115911916765
|
||||||
|
m_Value1: 16796494752743159762
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: ddfc297db310188ed2f7f768fc2219e9
|
||||||
|
m_Version: 2
|
||||||
|
m_FromPortReference:
|
||||||
|
m_NodeModelGuid:
|
||||||
|
m_Value0: 1990642935411556156
|
||||||
|
m_Value1: 16710028644464764280
|
||||||
|
m_NodeModelHashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 3cbfd8ef332fa01b78a5ecc384f2e5e7
|
||||||
|
m_UniqueId: out
|
||||||
|
m_PortDirection: 2
|
||||||
|
m_PortOrientation: 0
|
||||||
|
m_Title: out
|
||||||
|
m_ToPortReference:
|
||||||
|
m_NodeModelGuid:
|
||||||
|
m_Value0: 10537482371379217669
|
||||||
|
m_Value1: 805153394380735108
|
||||||
|
m_NodeModelHashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 05c5ff0463a83c928482c30dbf7a2c0b
|
||||||
|
m_UniqueId: in
|
||||||
|
m_PortDirection: 1
|
||||||
|
m_PortOrientation: 0
|
||||||
|
m_Title: in
|
||||||
|
- rid: 1219994508087787780
|
||||||
|
type: {class: WireModel, ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Guid:
|
||||||
|
m_Value0: 10375816761084646535
|
||||||
|
m_Value1: 15824079162718769611
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 8794feea5e4efe8fcb5183af286c9adb
|
||||||
|
m_Version: 2
|
||||||
|
m_FromPortReference:
|
||||||
|
m_NodeModelGuid:
|
||||||
|
m_Value0: 10537482371379217669
|
||||||
|
m_Value1: 805153394380735108
|
||||||
|
m_NodeModelHashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 05c5ff0463a83c928482c30dbf7a2c0b
|
||||||
|
m_UniqueId: out
|
||||||
|
m_PortDirection: 2
|
||||||
|
m_PortOrientation: 0
|
||||||
|
m_Title: out
|
||||||
|
m_ToPortReference:
|
||||||
|
m_NodeModelGuid:
|
||||||
|
m_Value0: 356371523793864382
|
||||||
|
m_Value1: 4751895819492649258
|
||||||
|
m_NodeModelHashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: be46cc430316f2042ae9853a1220f241
|
||||||
|
m_UniqueId: in
|
||||||
|
m_PortDirection: 1
|
||||||
|
m_PortOrientation: 0
|
||||||
|
m_Title: in
|
||||||
|
- rid: 1219994508087787813
|
||||||
|
type: {class: WireModel, ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Guid:
|
||||||
|
m_Value0: 10491986159911335451
|
||||||
|
m_Value1: 18287880145942505208
|
||||||
|
m_HashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 1b76d4d1d2059b91f866d271199acbfd
|
||||||
|
m_Version: 2
|
||||||
|
m_FromPortReference:
|
||||||
|
m_NodeModelGuid:
|
||||||
|
m_Value0: 4225538081375705477
|
||||||
|
m_Value1: 10816025756629798206
|
||||||
|
m_NodeModelHashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 85d948457f20a43a3e0d65b11e3e1a96
|
||||||
|
m_UniqueId: MainPortName
|
||||||
|
m_PortDirection: 2
|
||||||
|
m_PortOrientation: 0
|
||||||
|
m_Title: MainPortName
|
||||||
|
m_ToPortReference:
|
||||||
|
m_NodeModelGuid:
|
||||||
|
m_Value0: 13346176596883742728
|
||||||
|
m_Value1: 18083586785705260694
|
||||||
|
m_NodeModelHashGuid:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 0820e35ee72437b996f6e8e25ecef5fa
|
||||||
|
m_UniqueId: SpeakerName
|
||||||
|
m_PortDirection: 1
|
||||||
|
m_PortOrientation: 0
|
||||||
|
m_Title: SpeakerName
|
||||||
|
- rid: 1219994508087787857
|
||||||
|
type: {class: EnumConstant, ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value:
|
||||||
|
m_EnumType:
|
||||||
|
m_Identification: Editor.Dialogue.DialogueType, AppleHillsEditor, Version=0.0.0.0,
|
||||||
|
Culture=neutral, PublicKeyToken=null
|
||||||
|
m_Value: 0
|
||||||
|
m_EnumType:
|
||||||
|
m_Identification: Editor.Dialogue.DialogueType, AppleHillsEditor, Version=0.0.0.0,
|
||||||
|
Culture=neutral, PublicKeyToken=null
|
||||||
|
- rid: 1219994508087787858
|
||||||
|
type: {class: 'Constant`1[[System.Int32, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value: 1
|
||||||
|
- rid: 1219994508087787860
|
||||||
|
type: {class: EnumConstant, ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value:
|
||||||
|
m_EnumType:
|
||||||
|
m_Identification: Editor.Dialogue.DialogueType, AppleHillsEditor, Version=0.0.0.0,
|
||||||
|
Culture=neutral, PublicKeyToken=null
|
||||||
|
m_Value: 1
|
||||||
|
m_EnumType:
|
||||||
|
m_Identification: Editor.Dialogue.DialogueType, AppleHillsEditor, Version=0.0.0.0,
|
||||||
|
Culture=neutral, PublicKeyToken=null
|
||||||
|
- rid: 1219994508087787861
|
||||||
|
type: {class: 'Constant`1[[System.Int32, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value: 3
|
||||||
|
- rid: 1219994508087787863
|
||||||
|
type: {class: EnumConstant, ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value:
|
||||||
|
m_EnumType:
|
||||||
|
m_Identification: Editor.Dialogue.DialogueType, AppleHillsEditor, Version=0.0.0.0,
|
||||||
|
Culture=neutral, PublicKeyToken=null
|
||||||
|
m_Value: 0
|
||||||
|
m_EnumType:
|
||||||
|
m_Identification: Editor.Dialogue.DialogueType, AppleHillsEditor, Version=0.0.0.0,
|
||||||
|
Culture=neutral, PublicKeyToken=null
|
||||||
|
- rid: 1219994508087787864
|
||||||
|
type: {class: 'Constant`1[[System.Int32, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value: 1
|
||||||
|
- rid: 1219994508087787897
|
||||||
|
type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value:
|
||||||
|
- rid: 1219994508087787898
|
||||||
|
type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value:
|
||||||
|
- rid: 1219994508087787900
|
||||||
|
type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value:
|
||||||
|
- rid: 1219994508087787901
|
||||||
|
type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value:
|
||||||
|
- rid: 1219994508087787902
|
||||||
|
type: {class: 'Constant`1[[System.String, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value:
|
||||||
|
- rid: 1219994508087787904
|
||||||
|
type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value: 0
|
||||||
|
- rid: 1219994508087787905
|
||||||
|
type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value: 0
|
||||||
|
- rid: 1219994508087787906
|
||||||
|
type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor}
|
||||||
|
data:
|
||||||
|
m_Value: 0
|
||||||
7
Assets/Dialogue/TestDialogue.dialoguegraph.meta
Normal file
7
Assets/Dialogue/TestDialogue.dialoguegraph.meta
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9050f99a225035b40b415df272d2b341
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -4,7 +4,9 @@
|
|||||||
"references": [
|
"references": [
|
||||||
"GUID:d91d3f46515a6954caa674697afbf416",
|
"GUID:d91d3f46515a6954caa674697afbf416",
|
||||||
"GUID:69448af7b92c7f342b298e06a37122aa",
|
"GUID:69448af7b92c7f342b298e06a37122aa",
|
||||||
"GUID:9e24947de15b9834991c9d8411ea37cf"
|
"GUID:9e24947de15b9834991c9d8411ea37cf",
|
||||||
|
"GUID:70ef9a24f4cfc4aec911c1414e3f90ad",
|
||||||
|
"GUID:d1e08c06f8f9473888c892637c83c913"
|
||||||
],
|
],
|
||||||
"includePlatforms": [
|
"includePlatforms": [
|
||||||
"Editor"
|
"Editor"
|
||||||
|
|||||||
3
Assets/Editor/Dialogue.meta
Normal file
3
Assets/Editor/Dialogue.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5ced9daeaad4427f9feb953a53b6d3df
|
||||||
|
timeCreated: 1758869763
|
||||||
20
Assets/Editor/Dialogue/DialogueGraph.cs
Normal file
20
Assets/Editor/Dialogue/DialogueGraph.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEditor;
|
||||||
|
using Unity.GraphToolkit.Editor;
|
||||||
|
|
||||||
|
namespace Editor.Dialogue
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
[Graph(AssetExtension)]
|
||||||
|
public class DialogueGraph : Graph
|
||||||
|
{
|
||||||
|
public const string AssetExtension = "dialoguegraph";
|
||||||
|
|
||||||
|
[MenuItem("Assets/Create/Dialogue Graph", false)]
|
||||||
|
private static void CreateAssetFile()
|
||||||
|
{
|
||||||
|
GraphDatabase.PromptInProjectBrowserToCreateNewAsset<DialogueGraph>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Editor/Dialogue/DialogueGraph.cs.meta
Normal file
3
Assets/Editor/Dialogue/DialogueGraph.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: eff5cdbb7a22496e93560cffa5754029
|
||||||
|
timeCreated: 1758869773
|
||||||
84
Assets/Editor/Dialogue/DialogueGraphImporter.cs
Normal file
84
Assets/Editor/Dialogue/DialogueGraphImporter.cs
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEditor.AssetImporters;
|
||||||
|
using Unity.GraphToolkit.Editor;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Dialogue;
|
||||||
|
|
||||||
|
namespace Editor.Dialogue
|
||||||
|
{
|
||||||
|
[ScriptedImporter(1, DialogueGraph.AssetExtension)]
|
||||||
|
public class DialogueGraphImporter : ScriptedImporter
|
||||||
|
{
|
||||||
|
public override void OnImportAsset(AssetImportContext ctx)
|
||||||
|
{
|
||||||
|
DialogueGraph editorGraph = GraphDatabase.LoadGraphForImporter<DialogueGraph>(ctx.assetPath);
|
||||||
|
RuntimeDialogueGraph runtimeGraph = ScriptableObject.CreateInstance<RuntimeDialogueGraph>();
|
||||||
|
var nodeIDMap = new Dictionary<INode, string>();
|
||||||
|
|
||||||
|
foreach (var node in editorGraph.GetNodes())
|
||||||
|
{
|
||||||
|
nodeIDMap[node] = Guid.NewGuid().ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: This could be done in the above loop, but for clarity, I'm keeping it separate for now.
|
||||||
|
var startNode = editorGraph.GetNodes().OfType<StartNode>().FirstOrDefault();
|
||||||
|
if (startNode != null)
|
||||||
|
{
|
||||||
|
var entryPoint = startNode.GetOutputPorts().FirstOrDefault()?.firstConnectedPort;
|
||||||
|
if (entryPoint != null)
|
||||||
|
{
|
||||||
|
runtimeGraph.entryNodeID = nodeIDMap[entryPoint.GetNode()];
|
||||||
|
}
|
||||||
|
|
||||||
|
runtimeGraph.speakerName = GetPortValue<string>(startNode.GetInputPortByName("SpeakerName"));
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var iNode in editorGraph.GetNodes())
|
||||||
|
{
|
||||||
|
if (iNode is StartNode || iNode is EndNode)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var runtimeNode = new RuntimeDialogueNode{ nodeID = nodeIDMap[iNode]};
|
||||||
|
if (iNode is DialogueNode dialogueNode)
|
||||||
|
{
|
||||||
|
ProcessDialogueNode(dialogueNode, runtimeNode, nodeIDMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
runtimeGraph.allNodes.Add(runtimeNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.AddObjectToAsset("RuntimeData", runtimeGraph);
|
||||||
|
ctx.SetMainObject(runtimeGraph);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProcessDialogueNode(DialogueNode node, RuntimeDialogueNode runtimeNode, Dictionary<INode, string> nodeIDMap)
|
||||||
|
{
|
||||||
|
runtimeNode.dialogueLine = GetPortValue<string>(node.GetInputPortByName("DialogueLine"));
|
||||||
|
|
||||||
|
var nextNodePort = node.GetOutputPortByName("out")?.firstConnectedPort;
|
||||||
|
if (nextNodePort != null)
|
||||||
|
{
|
||||||
|
runtimeNode.nextNodeID = nodeIDMap[nextNodePort.GetNode()];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private T GetPortValue<T>(IPort port)
|
||||||
|
{
|
||||||
|
if (port == null) return default(T);
|
||||||
|
|
||||||
|
if (port.isConnected)
|
||||||
|
{
|
||||||
|
if (port.firstConnectedPort.GetNode() is IVariableNode variableNode)
|
||||||
|
{
|
||||||
|
variableNode.variable.TryGetDefaultValue(out T value);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
port.TryGetValue(out T fallbackValue);
|
||||||
|
return fallbackValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Editor/Dialogue/DialogueGraphImporter.cs.meta
Normal file
3
Assets/Editor/Dialogue/DialogueGraphImporter.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a2334d3ee5254a2bbcb316035c681b27
|
||||||
|
timeCreated: 1758871584
|
||||||
196
Assets/Editor/Dialogue/DialogueNodes.cs
Normal file
196
Assets/Editor/Dialogue/DialogueNodes.cs
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using Unity.GraphToolkit.Editor;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Editor.Dialogue
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public class StartNode : Node
|
||||||
|
{
|
||||||
|
protected override void OnDefinePorts(IPortDefinitionContext context)
|
||||||
|
{
|
||||||
|
context.AddOutputPort("out").Build();
|
||||||
|
|
||||||
|
context.AddInputPort<string>("SpeakerName").Build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class EndNode : Node
|
||||||
|
{
|
||||||
|
protected override void OnDefinePorts(IPortDefinitionContext context)
|
||||||
|
{
|
||||||
|
context.AddInputPort("in").Build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public enum DialogueType
|
||||||
|
{
|
||||||
|
SayOneLine,
|
||||||
|
SayMultipleLines
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class DialogueNode : Node
|
||||||
|
{
|
||||||
|
const string LineTypeOptionName = "DialogueLineType";
|
||||||
|
const string NoLinesOptionName = "NoLines";
|
||||||
|
const string LoopThroughDefaultLinesOptionName = "LoopThroughDefaultLines";
|
||||||
|
const string DefaultDialogueLineOptionName = "DefaultDialogueLine";
|
||||||
|
|
||||||
|
|
||||||
|
protected override void OnDefineOptions(IOptionDefinitionContext context)
|
||||||
|
{
|
||||||
|
context.AddOption<DialogueType>(LineTypeOptionName)
|
||||||
|
.WithDisplayName("Default Line Type")
|
||||||
|
.WithDefaultValue(DialogueType.SayOneLine)
|
||||||
|
.Delayed();
|
||||||
|
|
||||||
|
|
||||||
|
context.AddOption<int>(NoLinesOptionName)
|
||||||
|
.WithDisplayName("Number of Default Lines")
|
||||||
|
.WithDefaultValue(1)
|
||||||
|
.Delayed();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnDefinePorts(IPortDefinitionContext context)
|
||||||
|
{
|
||||||
|
context.AddInputPort("in").Build();
|
||||||
|
context.AddOutputPort("out").Build();
|
||||||
|
|
||||||
|
var lineTypeOption = GetNodeOptionByName(LineTypeOptionName);
|
||||||
|
lineTypeOption.TryGetValue<DialogueType>(out var lineType);
|
||||||
|
var lineCountOption = GetNodeOptionByName(NoLinesOptionName);
|
||||||
|
lineCountOption.TryGetValue<int>(out var lineCount);
|
||||||
|
|
||||||
|
if (lineType == DialogueType.SayMultipleLines)
|
||||||
|
{
|
||||||
|
for (var i = 0; i < lineCount; i++)
|
||||||
|
{
|
||||||
|
context.AddInputPort<string>($"{DefaultDialogueLineOptionName}{i + 1}").WithDisplayName($"Default Dialogue Line {i + 1}").Build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
context.AddInputPort<string>($"{DefaultDialogueLineOptionName}").WithDisplayName("Default Dialogue Line").Build();
|
||||||
|
}
|
||||||
|
|
||||||
|
context.AddInputPort<bool>($"{LoopThroughDefaultLinesOptionName}").WithDisplayName("Loop Through Default Lines?").Build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class WaitOnPuzzleStep : DialogueNode
|
||||||
|
{
|
||||||
|
const string RequiredPuzzleStep = "RequiredPuzzleStep";
|
||||||
|
|
||||||
|
protected override void OnDefinePorts(IPortDefinitionContext context)
|
||||||
|
{
|
||||||
|
context.AddInputPort<PuzzleStepSO>(RequiredPuzzleStep).WithDisplayName("Required Puzzle Step").Build();
|
||||||
|
|
||||||
|
base.OnDefinePorts(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class WaitOnPickup : DialogueNode
|
||||||
|
{
|
||||||
|
const string RequiredPickupsOptionName = "RequiredPickup";
|
||||||
|
|
||||||
|
protected override void OnDefinePorts(IPortDefinitionContext context)
|
||||||
|
{
|
||||||
|
context.AddInputPort<PickupItemData>(RequiredPickupsOptionName).WithDisplayName("Required Pickup").Build();
|
||||||
|
|
||||||
|
base.OnDefinePorts(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class WaitOnSlot : DialogueNode
|
||||||
|
{
|
||||||
|
const string RequiredSlotOptionName = "RequiredSlot";
|
||||||
|
// Incorrect item - i.e. not the correct one but also not forbidden
|
||||||
|
const string IncorrectItemLineTypeOptionName = "IncorrectItemDialogueLineType";
|
||||||
|
const string IncorrectItemNoLinesOptionName = "IncorrectItemNoLines";
|
||||||
|
const string LoopThroughIncorrectItemLinesOptionName = "LoopThroughIncorrectItemLines";
|
||||||
|
const string IncorrectIteDialogueLineOptionName = "IncorrectItemDialogueLine";
|
||||||
|
// Explicitely forbidden item
|
||||||
|
const string ForbiddenItemLineTypeOptionName = "ForbiddenItemDialogueLineType";
|
||||||
|
const string ForbiddenItemNoLinesOptionName = "ForbiddenItemNoLines";
|
||||||
|
const string LoopThroughForbiddenItemLinesOptionName = "LoopThroughForbiddenItemLines";
|
||||||
|
const string ForbiddenIteDialogueLineOptionName = "ForbiddenItemDialogueLine";
|
||||||
|
|
||||||
|
protected override void OnDefineOptions(IOptionDefinitionContext context)
|
||||||
|
{
|
||||||
|
base.OnDefineOptions(context);
|
||||||
|
|
||||||
|
// Incorrect
|
||||||
|
context.AddOption<DialogueType>(IncorrectItemLineTypeOptionName)
|
||||||
|
.WithDisplayName("Incorrect Item Line Type")
|
||||||
|
.WithDefaultValue(DialogueType.SayOneLine)
|
||||||
|
.Delayed();
|
||||||
|
context.AddOption<int>(IncorrectItemNoLinesOptionName)
|
||||||
|
.WithDisplayName("Number of Incorrect Item Lines")
|
||||||
|
.WithDefaultValue(1)
|
||||||
|
.Delayed();
|
||||||
|
|
||||||
|
// Forbidden
|
||||||
|
context.AddOption<DialogueType>(ForbiddenItemLineTypeOptionName)
|
||||||
|
.WithDisplayName("Forbidden Item Line Type")
|
||||||
|
.WithDefaultValue(DialogueType.SayOneLine)
|
||||||
|
.Delayed();
|
||||||
|
context.AddOption<int>(ForbiddenItemNoLinesOptionName)
|
||||||
|
.WithDisplayName("Forbidden of Incorrect Item Lines")
|
||||||
|
.WithDefaultValue(1)
|
||||||
|
.Delayed();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnDefinePorts(IPortDefinitionContext context)
|
||||||
|
{
|
||||||
|
context.AddInputPort<PickupItemData>(RequiredSlotOptionName).WithDisplayName("Required Slot").Build();
|
||||||
|
|
||||||
|
base.OnDefinePorts(context);
|
||||||
|
|
||||||
|
// Incorrect
|
||||||
|
var incorrectItemLineTypeOption = GetNodeOptionByName(IncorrectItemLineTypeOptionName);
|
||||||
|
incorrectItemLineTypeOption.TryGetValue<DialogueType>(out var incorrectItemLineType);
|
||||||
|
var incorrectItemLineCountOption = GetNodeOptionByName(IncorrectItemNoLinesOptionName);
|
||||||
|
incorrectItemLineCountOption.TryGetValue<int>(out var incorrectItemLineCount);
|
||||||
|
|
||||||
|
if (incorrectItemLineType == DialogueType.SayMultipleLines)
|
||||||
|
{
|
||||||
|
for (var i = 0; i < incorrectItemLineCount; i++)
|
||||||
|
{
|
||||||
|
context.AddInputPort<string>($"{IncorrectIteDialogueLineOptionName}{i + 1}").WithDisplayName($"Incorrect Item Dialogue Line {i + 1}").Build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
context.AddInputPort<string>($"{IncorrectIteDialogueLineOptionName}").WithDisplayName("Incorrect Item Dialogue Line").Build();
|
||||||
|
}
|
||||||
|
|
||||||
|
context.AddInputPort<bool>($"{LoopThroughIncorrectItemLinesOptionName}").WithDisplayName("Loop Through Incorrect Item Lines?").Build();
|
||||||
|
|
||||||
|
// Forbidden
|
||||||
|
var forbiddenItemLineTypeOption = GetNodeOptionByName(ForbiddenItemLineTypeOptionName);
|
||||||
|
forbiddenItemLineTypeOption.TryGetValue<DialogueType>(out var forbiddenItemLineType);
|
||||||
|
var forbiddenItemLineCountOption = GetNodeOptionByName(ForbiddenItemNoLinesOptionName);
|
||||||
|
forbiddenItemLineCountOption.TryGetValue<int>(out var forbiddenItemLineCount);
|
||||||
|
|
||||||
|
if (forbiddenItemLineType == DialogueType.SayMultipleLines)
|
||||||
|
{
|
||||||
|
for (var i = 0; i < forbiddenItemLineCount; i++)
|
||||||
|
{
|
||||||
|
context.AddInputPort<string>($"{ForbiddenIteDialogueLineOptionName}{i + 1}").WithDisplayName($"Forbidden Item Dialogue Line {i + 1}").Build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
context.AddInputPort<string>($"{ForbiddenIteDialogueLineOptionName}").WithDisplayName("Forbidden Item Dialogue Line").Build();
|
||||||
|
}
|
||||||
|
|
||||||
|
context.AddInputPort<bool>($"{LoopThroughForbiddenItemLinesOptionName}").WithDisplayName("Loop Through Forbidden Item Lines?").Build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Editor/Dialogue/DialogueNodes.cs.meta
Normal file
3
Assets/Editor/Dialogue/DialogueNodes.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a8b3213c46b447a9adc5627a273f2b2d
|
||||||
|
timeCreated: 1758870466
|
||||||
@@ -52,6 +52,8 @@ SpriteRenderer:
|
|||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
m_SmallMeshCulling: 1
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
m_RenderingLayerMask: 1
|
m_RenderingLayerMask: 1
|
||||||
m_RendererPriority: 0
|
m_RendererPriority: 0
|
||||||
m_Materials:
|
m_Materials:
|
||||||
@@ -73,6 +75,7 @@ SpriteRenderer:
|
|||||||
m_AutoUVMaxDistance: 0.5
|
m_AutoUVMaxDistance: 0.5
|
||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 1
|
m_SortingOrder: 1
|
||||||
@@ -147,6 +150,8 @@ SpriteRenderer:
|
|||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
m_SmallMeshCulling: 1
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
m_RenderingLayerMask: 1
|
m_RenderingLayerMask: 1
|
||||||
m_RendererPriority: 0
|
m_RendererPriority: 0
|
||||||
m_Materials:
|
m_Materials:
|
||||||
@@ -168,6 +173,7 @@ SpriteRenderer:
|
|||||||
m_AutoUVMaxDistance: 0.5
|
m_AutoUVMaxDistance: 0.5
|
||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ SpriteRenderer:
|
|||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
m_SmallMeshCulling: 1
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
m_RenderingLayerMask: 1
|
m_RenderingLayerMask: 1
|
||||||
m_RendererPriority: 0
|
m_RendererPriority: 0
|
||||||
m_Materials:
|
m_Materials:
|
||||||
@@ -73,6 +75,7 @@ SpriteRenderer:
|
|||||||
m_AutoUVMaxDistance: 0.5
|
m_AutoUVMaxDistance: 0.5
|
||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 1
|
m_SortingOrder: 1
|
||||||
@@ -139,6 +142,8 @@ SpriteRenderer:
|
|||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
m_SmallMeshCulling: 1
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
m_RenderingLayerMask: 1
|
m_RenderingLayerMask: 1
|
||||||
m_RendererPriority: 0
|
m_RendererPriority: 0
|
||||||
m_Materials:
|
m_Materials:
|
||||||
@@ -160,6 +165,7 @@ SpriteRenderer:
|
|||||||
m_AutoUVMaxDistance: 0.5
|
m_AutoUVMaxDistance: 0.5
|
||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 1
|
m_SortingOrder: 1
|
||||||
@@ -234,6 +240,8 @@ SpriteRenderer:
|
|||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
m_SmallMeshCulling: 1
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
m_RenderingLayerMask: 1
|
m_RenderingLayerMask: 1
|
||||||
m_RendererPriority: 0
|
m_RendererPriority: 0
|
||||||
m_Materials:
|
m_Materials:
|
||||||
@@ -255,6 +263,7 @@ SpriteRenderer:
|
|||||||
m_AutoUVMaxDistance: 0.5
|
m_AutoUVMaxDistance: 0.5
|
||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
|
|||||||
@@ -135,6 +135,8 @@ SpriteRenderer:
|
|||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
m_SmallMeshCulling: 1
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
m_RenderingLayerMask: 1
|
m_RenderingLayerMask: 1
|
||||||
m_RendererPriority: 0
|
m_RendererPriority: 0
|
||||||
m_Materials:
|
m_Materials:
|
||||||
@@ -156,6 +158,7 @@ SpriteRenderer:
|
|||||||
m_AutoUVMaxDistance: 0.5
|
m_AutoUVMaxDistance: 0.5
|
||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 1
|
m_SortingOrder: 1
|
||||||
@@ -232,6 +235,8 @@ SpriteRenderer:
|
|||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
m_SmallMeshCulling: 1
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
m_RenderingLayerMask: 1
|
m_RenderingLayerMask: 1
|
||||||
m_RendererPriority: 0
|
m_RendererPriority: 0
|
||||||
m_Materials:
|
m_Materials:
|
||||||
@@ -253,6 +258,7 @@ SpriteRenderer:
|
|||||||
m_AutoUVMaxDistance: 0.5
|
m_AutoUVMaxDistance: 0.5
|
||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ SpriteRenderer:
|
|||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
m_SmallMeshCulling: 1
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
m_RenderingLayerMask: 1
|
m_RenderingLayerMask: 1
|
||||||
m_RendererPriority: 0
|
m_RendererPriority: 0
|
||||||
m_Materials:
|
m_Materials:
|
||||||
@@ -112,6 +114,7 @@ SpriteRenderer:
|
|||||||
m_AutoUVMaxDistance: 0.5
|
m_AutoUVMaxDistance: 0.5
|
||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
@@ -341,6 +344,8 @@ SpriteRenderer:
|
|||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
m_SmallMeshCulling: 1
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
m_RenderingLayerMask: 1
|
m_RenderingLayerMask: 1
|
||||||
m_RendererPriority: 0
|
m_RendererPriority: 0
|
||||||
m_Materials:
|
m_Materials:
|
||||||
@@ -362,6 +367,7 @@ SpriteRenderer:
|
|||||||
m_AutoUVMaxDistance: 0.5
|
m_AutoUVMaxDistance: 0.5
|
||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ SpriteRenderer:
|
|||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
m_SmallMeshCulling: 1
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
m_RenderingLayerMask: 1
|
m_RenderingLayerMask: 1
|
||||||
m_RendererPriority: 0
|
m_RendererPriority: 0
|
||||||
m_Materials:
|
m_Materials:
|
||||||
@@ -76,6 +78,7 @@ SpriteRenderer:
|
|||||||
m_AutoUVMaxDistance: 0.5
|
m_AutoUVMaxDistance: 0.5
|
||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 1
|
m_SortingOrder: 1
|
||||||
|
|||||||
@@ -172,6 +172,8 @@ SpriteRenderer:
|
|||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
m_SmallMeshCulling: 1
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
m_RenderingLayerMask: 1
|
m_RenderingLayerMask: 1
|
||||||
m_RendererPriority: 0
|
m_RendererPriority: 0
|
||||||
m_Materials:
|
m_Materials:
|
||||||
@@ -193,6 +195,7 @@ SpriteRenderer:
|
|||||||
m_AutoUVMaxDistance: 0.5
|
m_AutoUVMaxDistance: 0.5
|
||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
@@ -253,6 +256,51 @@ BoxCollider2D:
|
|||||||
m_AutoTiling: 0
|
m_AutoTiling: 0
|
||||||
m_Size: {x: 1, y: 1}
|
m_Size: {x: 1, y: 1}
|
||||||
m_EdgeRadius: 0
|
m_EdgeRadius: 0
|
||||||
|
--- !u!1 &1334266842
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1334266844}
|
||||||
|
- component: {fileID: 1334266843}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: DialogueTest
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &1334266843
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1334266842}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 749c3dece1c14b82845c175203a2e7dc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: AppleHillsScripts::Dialogue.DialogueComponent
|
||||||
|
runtimeGraph: {fileID: 3965311268370046156, guid: 9050f99a225035b40b415df272d2b341, type: 3}
|
||||||
|
--- !u!4 &1334266844
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1334266842}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -3.64555, y: 2.05444, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &1507068790
|
--- !u!1 &1507068790
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -264,6 +312,7 @@ GameObject:
|
|||||||
- component: {fileID: 1507068793}
|
- component: {fileID: 1507068793}
|
||||||
- component: {fileID: 1507068792}
|
- component: {fileID: 1507068792}
|
||||||
- component: {fileID: 1507068791}
|
- component: {fileID: 1507068791}
|
||||||
|
- component: {fileID: 1507068794}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Main Camera
|
m_Name: Main Camera
|
||||||
m_TagString: MainCamera
|
m_TagString: MainCamera
|
||||||
@@ -345,6 +394,50 @@ Transform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &1507068794
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1507068790}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalAdditionalCameraData
|
||||||
|
m_RenderShadows: 1
|
||||||
|
m_RequiresDepthTextureOption: 2
|
||||||
|
m_RequiresOpaqueTextureOption: 2
|
||||||
|
m_CameraType: 0
|
||||||
|
m_Cameras: []
|
||||||
|
m_RendererIndex: -1
|
||||||
|
m_VolumeLayerMask:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 1
|
||||||
|
m_VolumeTrigger: {fileID: 0}
|
||||||
|
m_VolumeFrameworkUpdateModeOption: 2
|
||||||
|
m_RenderPostProcessing: 0
|
||||||
|
m_Antialiasing: 0
|
||||||
|
m_AntialiasingQuality: 2
|
||||||
|
m_StopNaN: 0
|
||||||
|
m_Dithering: 0
|
||||||
|
m_ClearDepth: 1
|
||||||
|
m_AllowXRRendering: 1
|
||||||
|
m_AllowHDROutput: 1
|
||||||
|
m_UseScreenCoordOverride: 0
|
||||||
|
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_RequiresDepthTexture: 0
|
||||||
|
m_RequiresColorTexture: 0
|
||||||
|
m_TaaSettings:
|
||||||
|
m_Quality: 3
|
||||||
|
m_FrameInfluence: 0.1
|
||||||
|
m_JitterScale: 1
|
||||||
|
m_MipBias: 0
|
||||||
|
m_VarianceClampScale: 0.9
|
||||||
|
m_ContrastAdaptiveSharpening: 0
|
||||||
|
m_Version: 2
|
||||||
--- !u!1 &1851499346
|
--- !u!1 &1851499346
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -429,6 +522,8 @@ SpriteRenderer:
|
|||||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
m_RayTracingAccelStructBuildFlags: 1
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
m_SmallMeshCulling: 1
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
m_RenderingLayerMask: 1
|
m_RenderingLayerMask: 1
|
||||||
m_RendererPriority: 0
|
m_RendererPriority: 0
|
||||||
m_Materials:
|
m_Materials:
|
||||||
@@ -450,6 +545,7 @@ SpriteRenderer:
|
|||||||
m_AutoUVMaxDistance: 0.5
|
m_AutoUVMaxDistance: 0.5
|
||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
@@ -518,3 +614,4 @@ SceneRoots:
|
|||||||
- {fileID: 1851499349}
|
- {fileID: 1851499349}
|
||||||
- {fileID: 2029728268}
|
- {fileID: 2029728268}
|
||||||
- {fileID: 465048834}
|
- {fileID: 465048834}
|
||||||
|
- {fileID: 1334266844}
|
||||||
|
|||||||
3
Assets/Scripts/Dialogue.meta
Normal file
3
Assets/Scripts/Dialogue.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e592597a12a7498dbb5336395d7db00c
|
||||||
|
timeCreated: 1758871403
|
||||||
63
Assets/Scripts/Dialogue/DialogueComponent.cs
Normal file
63
Assets/Scripts/Dialogue/DialogueComponent.cs
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.InputSystem;
|
||||||
|
|
||||||
|
namespace Dialogue
|
||||||
|
{
|
||||||
|
public class DialogueComponent : MonoBehaviour
|
||||||
|
{
|
||||||
|
[SerializeField]
|
||||||
|
private RuntimeDialogueGraph runtimeGraph;
|
||||||
|
private Dictionary<string, RuntimeDialogueNode> _nodeLookup = new Dictionary<string, RuntimeDialogueNode>();
|
||||||
|
private RuntimeDialogueNode _currentNode;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
foreach (var node in runtimeGraph.allNodes)
|
||||||
|
{
|
||||||
|
_nodeLookup[node.nodeID] = node;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(string.IsNullOrEmpty(runtimeGraph.entryNodeID))
|
||||||
|
{
|
||||||
|
EndDialogue();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ShowNode(runtimeGraph.entryNodeID);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if(Mouse.current.leftButton.wasPressedThisFrame && _currentNode != null)
|
||||||
|
{
|
||||||
|
if(string.IsNullOrEmpty(_currentNode.nextNodeID))
|
||||||
|
{
|
||||||
|
EndDialogue();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowNode(_currentNode.nextNodeID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowNode(string nodeID)
|
||||||
|
{
|
||||||
|
if (!_nodeLookup.ContainsKey(nodeID))
|
||||||
|
{
|
||||||
|
EndDialogue();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentNode = _nodeLookup[nodeID];
|
||||||
|
Debug.Log($"{runtimeGraph.speakerName}: {_currentNode.dialogueLine}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EndDialogue()
|
||||||
|
{
|
||||||
|
Application.Quit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Dialogue/DialogueComponent.cs.meta
Normal file
3
Assets/Scripts/Dialogue/DialogueComponent.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 749c3dece1c14b82845c175203a2e7dc
|
||||||
|
timeCreated: 1758873871
|
||||||
22
Assets/Scripts/Dialogue/RuntimeDialogueGraph.cs
Normal file
22
Assets/Scripts/Dialogue/RuntimeDialogueGraph.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Dialogue
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public class RuntimeDialogueGraph : ScriptableObject
|
||||||
|
{
|
||||||
|
public string entryNodeID;
|
||||||
|
public string speakerName;
|
||||||
|
public List<RuntimeDialogueNode> allNodes = new List<RuntimeDialogueNode>();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class RuntimeDialogueNode
|
||||||
|
{
|
||||||
|
public string nodeID;
|
||||||
|
public string dialogueLine;
|
||||||
|
public string nextNodeID;
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Dialogue/RuntimeDialogueGraph.cs.meta
Normal file
3
Assets/Scripts/Dialogue/RuntimeDialogueGraph.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3c3be3596532450a923c31dfe0ed4aa9
|
||||||
|
timeCreated: 1758871423
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using PuzzleS;
|
using PuzzleS;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
|
using System; // added for Action<T>
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Manages puzzle step registration, dependency management, and step completion for the puzzle system.
|
/// Manages puzzle step registration, dependency management, and step completion for the puzzle system.
|
||||||
@@ -32,6 +33,10 @@ public class PuzzleManager : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Events to notify about step lifecycle
|
||||||
|
public event Action<PuzzleStepSO> StepCompleted;
|
||||||
|
public event Action<PuzzleStepSO> StepUnlocked;
|
||||||
|
|
||||||
private HashSet<PuzzleStepSO> completedSteps = new HashSet<PuzzleStepSO>();
|
private HashSet<PuzzleStepSO> completedSteps = new HashSet<PuzzleStepSO>();
|
||||||
private HashSet<PuzzleStepSO> unlockedSteps = new HashSet<PuzzleStepSO>();
|
private HashSet<PuzzleStepSO> unlockedSteps = new HashSet<PuzzleStepSO>();
|
||||||
|
|
||||||
@@ -122,6 +127,10 @@ public class PuzzleManager : MonoBehaviour
|
|||||||
if (completedSteps.Contains(step)) return;
|
if (completedSteps.Contains(step)) return;
|
||||||
completedSteps.Add(step);
|
completedSteps.Add(step);
|
||||||
Debug.Log($"[Puzzles] Step completed: {step.stepId}");
|
Debug.Log($"[Puzzles] Step completed: {step.stepId}");
|
||||||
|
|
||||||
|
// Broadcast completion
|
||||||
|
StepCompleted?.Invoke(step);
|
||||||
|
|
||||||
foreach (var unlock in step.unlocks)
|
foreach (var unlock in step.unlocks)
|
||||||
{
|
{
|
||||||
if (AreRuntimeDependenciesMet(unlock))
|
if (AreRuntimeDependenciesMet(unlock))
|
||||||
@@ -165,6 +174,9 @@ public class PuzzleManager : MonoBehaviour
|
|||||||
behaviour.UnlockStep();
|
behaviour.UnlockStep();
|
||||||
}
|
}
|
||||||
Debug.Log($"[Puzzles] Step unlocked: {step.stepId}");
|
Debug.Log($"[Puzzles] Step unlocked: {step.stepId}");
|
||||||
|
|
||||||
|
// Broadcast unlock
|
||||||
|
StepUnlocked?.Invoke(step);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user