Skip to content

Commit 4fef38c

Browse files
committed
feat(variables): added global database actions and conditions
You can now create actions and conditions that persist across dialogue conversations. The database where these are stored can be saved and loaded from a string if needed.
1 parent 558c869 commit 4fef38c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+755
-43
lines changed

Assets/Examples/BasicConversation/ExampleConversation.asset

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,22 @@ MonoBehaviour:
144144
choices: []
145145
actor: {fileID: 11400000, guid: aebb863e25cae0a4495c09b6a617ecf6, type: 2}
146146
dialogue: They're doing fine. You've got bigger things to worry about.
147+
--- !u!114 &-7021118909226780551
148+
MonoBehaviour:
149+
m_ObjectHideFlags: 1
150+
m_CorrespondingSourceObject: {fileID: 0}
151+
m_PrefabInstance: {fileID: 0}
152+
m_PrefabAsset: {fileID: 0}
153+
m_GameObject: {fileID: 0}
154+
m_Enabled: 1
155+
m_EditorHideFlags: 0
156+
m_Script: {fileID: 11500000, guid: dc39c8b552b94c01a6ae86d4b8cce494, type: 3}
157+
m_Name: SetGlobalBool
158+
m_EditorClassIdentifier:
159+
_title: SetGlobalBool humans asked
160+
_uniqueId: 067fa933-713f-4ff1-860b-4051d4c9b040
161+
_value: 1
162+
_variable: {fileID: 11400000, guid: 1906dabbacd5b15429089da6c10fd23d, type: 2}
147163
--- !u!114 &-6868820908879997394
148164
MonoBehaviour:
149165
m_ObjectHideFlags: 1
@@ -306,6 +322,7 @@ MonoBehaviour:
306322
conditions: []
307323
enterActions:
308324
- {fileID: -4687762883489335130}
325+
- {fileID: -7021118909226780551}
309326
exitActions: []
310327
choices: []
311328
actor: {fileID: 11400000, guid: d6a8e0fd1eb801d4ca00320f6b2e9e8b, type: 2}
@@ -470,7 +487,7 @@ MonoBehaviour:
470487
- {fileID: -1221359623688907011}
471488
- {fileID: 3721123120546049034}
472489
root: {fileID: 426936237664981933}
473-
scrollPosition: {x: 50450.676, y: 49996}
490+
scrollPosition: {x: 50404.676, y: 50073}
474491
--- !u!114 &373158185418196577
475492
MonoBehaviour:
476493
m_ObjectHideFlags: 0

Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Actions.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using CleverCrow.Fluid.Databases;
2+
using UnityEngine;
3+
4+
namespace CleverCrow.Fluid.Dialogues.Actions.Databases {
5+
[CreateMenu("Database/Globals/Set Bool")]
6+
public class SetGlobalBool : SetLocalVariableBase<bool> {
7+
[SerializeField]
8+
public KeyValueDefinitionBool _variable;
9+
10+
protected override KeyValueDefinitionBase<bool> Variable => _variable;
11+
12+
protected override IKeyValueData<bool> GetDatabase (IDialogueController dialogue) {
13+
return GlobalDatabaseManager.Instance.Database.Bools;
14+
}
15+
}
16+
}

Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Actions/SetGlobalBool.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using CleverCrow.Fluid.Databases;
2+
using UnityEngine;
3+
4+
namespace CleverCrow.Fluid.Dialogues.Actions.Databases {
5+
[CreateMenu("Database/Globals/Set Float")]
6+
public class SetGlobalFloat : SetLocalVariableBase<float> {
7+
[SerializeField]
8+
public KeyValueDefinitionFloat _variable;
9+
10+
protected override KeyValueDefinitionBase<float> Variable => _variable;
11+
12+
protected override IKeyValueData<float> GetDatabase (IDialogueController dialogue) {
13+
return GlobalDatabaseManager.Instance.Database.Floats;
14+
}
15+
}
16+
}

Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Actions/SetGlobalFloat.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using CleverCrow.Fluid.Databases;
2+
using UnityEngine;
3+
4+
namespace CleverCrow.Fluid.Dialogues.Actions.Databases {
5+
[CreateMenu("Database/Globals/Set Int")]
6+
public class SetGlobalInt : SetLocalVariableBase<int> {
7+
[SerializeField]
8+
public KeyValueDefinitionInt _variable;
9+
10+
protected override KeyValueDefinitionBase<int> Variable => _variable;
11+
12+
protected override IKeyValueData<int> GetDatabase (IDialogueController dialogue) {
13+
return GlobalDatabaseManager.Instance.Database.Ints;
14+
}
15+
}
16+
}

Assets/com.fluid.dialogue/Runtime/Actions/Libraries/Databases/Globals/Actions/SetGlobalInt.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using CleverCrow.Fluid.Databases;
2+
using UnityEngine;
3+
4+
namespace CleverCrow.Fluid.Dialogues.Actions.Databases {
5+
[CreateMenu("Database/Globals/Set String")]
6+
public class SetGlobalString : SetLocalVariableBase<string> {
7+
[SerializeField]
8+
public KeyValueDefinitionString _variable;
9+
10+
protected override KeyValueDefinitionBase<string> Variable => _variable;
11+
12+
protected override IKeyValueData<string> GetDatabase (IDialogueController dialogue) {
13+
return GlobalDatabaseManager.Instance.Database.Strings;
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)