Skip to content

Commit 6de727e

Browse files
authored
Merge pull request #2 from ashblue/feature/documentation
Feature/documentation
2 parents 7024b3c + cbe7d63 commit 6de727e

File tree

7 files changed

+121
-16
lines changed

7 files changed

+121
-16
lines changed

Assets/FluidDialogue.meta

-8
This file was deleted.

Assets/FluidDialogue/Tests.meta

-3
This file was deleted.

Assets/FluidDialogue/Tests/Editor.meta

-3
This file was deleted.

Assets/com.fluid.dialogue/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"description": "A Unity dialogue system that features an easy to use drag and drop graph. ScriptableObject driven with the ability to write custom actions and conditions to create complex dialogue workflows.",
66
"unity": "2019.1",
77
"dependencies": {
8-
"com.fluid.database": "1.0.1"
8+
"com.fluid.database": "1.0.2"
99
}
1010
}

Packages/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"dependencies": {
1313
"clever-crow.nsubstitute": "2.0.3",
14-
"com.fluid.database": "1.0.1",
14+
"com.fluid.database": "1.0.2",
1515
"com.unity.ads": "2.0.8",
1616
"com.unity.analytics": "3.3.2",
1717
"com.unity.collab-proxy": "1.2.16",

README.md

+119
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,66 @@
22

33
A Unity dialogue system that features an easy to use drag and drop graph. ScriptableObject driven with the ability to write custom actions and conditions to create complex dialogue workflows.
44

5+
* **Visual graph** editor
6+
* Ability to create custom **actions** that execute as dialogue progresses
7+
* Create custom **conditions** to determine how dialogue branches
8+
* Built in **local database** to set and check variables for branching
9+
* Allows you to **bring your own UI** or use a starter example (event driven dialogue presentation)
10+
11+
![](docs/example-dialogue.png)
12+
13+
**Support**
14+
15+
Join the [Discord Community](https://discord.gg/8QHFfzn) if you have questions or need help.
16+
17+
See upcoming features and development progress on the [Trello Board](https://trello.com/b/wMrsWyxn/fluid-dialogue).
18+
19+
## Getting Started
20+
21+
First you'll need to [install](#installation) the package with Unity Package Manager. After that you can create a database as follows.
22+
23+
1. Right click on the project window
24+
1. Create -> Fluid -> Dialogue -> Graph
25+
1. Click "Edit Dialogue" to customize your graph
26+
27+
To create a custom UI to display your graph, you'll need to handle a series of events emitted by the dialogue controller. You can find a full example of this in the [Examples](#examples) folder.
28+
29+
### Node Types
30+
31+
There are a few different node types. Each with a specific focus in mind.
32+
33+
* Dialogue: Choices and text from a specific actor
34+
* Hub: Used to route dialogue logic without triggering any dialogue or choices
35+
* Choice Hub: Used to trigger a set of choices multiple times
36+
37+
### Actors
38+
39+
Every dialogue should have an actor assigned to it. Actors can be created with the following steps.
40+
41+
1. Right click on the project window
42+
1. Create -> Fluid -> Dialogue -> Actor
43+
44+
### Actions
45+
46+
Actions can be added after selecting a node. They can be triggered before a node activates (enter actions) or after a node is complete (exit actions). Note that actions can activate with a delay.
47+
48+
### Conditions
49+
50+
Conditions are just like actions. Except if any of them return false the node will be skipped at runtime until it's evaluated again.
51+
52+
### Local Variables
53+
54+
To create a local variable and use it do the following.
55+
56+
1. Right click on the project window
57+
1. Create -> Fluid -> Database -> Choose a variable type
58+
59+
To use the variable simply select a node on the graph. Then click the plus sign on a condition (variable checks) or action (change variable value) in the inspector. Please note you must assign the variable you just created to use it.
60+
61+
### Examples
62+
63+
To see the entire Fluid Dialogue workflow, it's highly recommended that you download this repo and run projects in the `Assets/Examples` folder.
64+
565
## Installation
666

767
Fluid Dialogue is used through [Unity's Package Manager](https://docs.unity3d.com/Manual/CustomPackages.html). In order to use it you'll need to add the following lines to your `Packages/manifest.json` file. After that you'll be able to visually control what specific version of Fluid Dialogue you're using from the package manager window in Unity. This has to be done so your Unity editor can connect to NPM's package registry.
@@ -23,6 +83,65 @@ Fluid Dialogue is used through [Unity's Package Manager](https://docs.unity3d.co
2383
}
2484
```
2585

86+
## APIs
87+
88+
The following APIs are available for customizing your dialogue experience.
89+
90+
### Custom Actions
91+
92+
You can create your own custom actions for the dialogue tree with the following API syntax.
93+
94+
```c#
95+
using CleverCrow.Fluid.Dialogues.Actions;
96+
using CleverCrow.Fluid.Dialogues;
97+
98+
[CreateMenu("Custom/My Action")]
99+
public class CustomAction : ActionDataBase {
100+
public override void OnInit (IDialogueController dialogue) {
101+
// Run the first time the action is triggered
102+
}
103+
104+
public override void OnStart () {
105+
// Runs when the action begins triggering
106+
}
107+
108+
public override ActionStatus OnUpdate () {
109+
// Runs when the action begins triggering
110+
111+
// Return continue to span multiple frames
112+
return ActionStatus.Success;
113+
}
114+
115+
public override void OnExit () {
116+
// Runs when the actions `OnUpdate()` returns `ActionStatus.Success`
117+
}
118+
119+
public override void OnReset () {
120+
// Runs after a node has fully run through the start, update, and exit cycle
121+
}
122+
}
123+
```
124+
125+
### Custom Conditions
126+
127+
Custom conditions can be crafted with the following API.
128+
129+
```c#
130+
using CleverCrow.Fluid.Dialogues;
131+
using CleverCrow.Fluid.Dialogues.Conditions;
132+
133+
public class CustomCondition : ConditionDataBase {
134+
public override void OnInit (IDialogueController dialogue) {
135+
// Triggered on first time setup
136+
}
137+
138+
public override bool OnGetIsValid () {
139+
// Place node condition logic here
140+
return true;
141+
}
142+
}
143+
```
144+
26145
## Releases
27146

28147
Archives of specific versions and release notes are available on the [releases page](https://github.com/ashblue/fluid-dialogue/releases).

docs/example-dialogue.png

108 KB
Loading

0 commit comments

Comments
 (0)