Skip to content

Commit

Permalink
Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
BDeshiDev committed Jun 11, 2024
1 parent 21ffd0e commit 7b8f24a
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 17 deletions.
52 changes: 45 additions & 7 deletions Assets/Packages/com.studio23.ss2.dialoguesystem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@
<a href="https://openupm.com/packages/com.studio23.ss2.dialoguesystem/"><img src="https://img.shields.io/npm/v/com.studio23.ss2.dialoguesystem?label=openupm&amp;registry_uri=https://package.openupm.com" /></a>
</p>

Dialogue System is a package created for tooling Silent Scream 2 Game. However it can be used for most games. It provides a set of tools to streamline your in game dialogue system needs.
Dialogue System is an open source package for dialogue in your game. It supports:
1. Dialogue Choices
2. Unity localization support
3. Custom editor for easily writing lines. No need to wrangle with the localization UI.
4. Node based UI
5. Timeline support

![Dialogue Graph](Screenshots/2.png)
![View](Screenshots/3.png)

## Table of Contents

1. [Installation](#installation)
2. [Usage](#usage)


## Installation

### Install via Git URL
Expand All @@ -25,12 +28,47 @@ https://github.com/Studio-23-xyz/com.studio23.ss2.dialoguesystem.git#upm
## Usage

### Using Dialogue System
1. Create a dialogue graph.
2. `DialogueManager.Instance.StartDialogue(graph)`
Samples contain an example of a helper monobehavior that keeps a reference to a graph and allows starting dialogues from there.

### Dialogue Graph Rules:
1. Must have at least one startnode. If you have multiple startnodes, please read the corresponding section.
2. If anything can be connected, you can connect them.

### Adding UI
The sample scene contains example UI. You can create your own UI by using the following events in `DialogueSystem.cs`:
```
public event Action<bool> OnSkipToggled;
public event Action<DialogueGraph> OnDialogueStarted;
public event Action<DialogueGraph> OnDialogueEnded;
public event Action<DialogueChoicesNode> OnDialogueChoiceStarted;
public event Action<DialogueChoicesNode> OnDialogueChoiceEnded;
```
### Multiple Startnodes in graph:
By default it takes the first startnode it finds. If you have multiple start nodes, this is unreliable. In this case, pass the specific startnode you want to start with.
```
DialogueSystem.Instance.StartDialogue(DialogueNodeBase node);
```
Or:
```
DialogueSystem.Instance.PlayDialogue(DialogueNodeBase node);
```
The node can be any node, not just a startnode. The samples contain a helper class with a custom editor that will help you pick startnodes if you have multiple.

1. Access the Wizard from top toolbar Studio-23 > Dialogue System > Dialogue System Wizard
### Timeline Support
The samples contain examples of timeline support with custom timeline clips utilizing the dialogue system. You'll need to have:
1. A DialogueManager active in the scene
2. Assign a DialogueUI to the track.

2. Follow the process in the Wizard to create your Dialogue Graphs.
The samples contain an example DialogueUI base class. The base class isn't required for the rest of the package but required for timeline support. Any UI that ingherits it can be assigned to the track.

3. Add the Dialogue Manager Singleton in your Scene
Note: Editor preview for dialogue clips only shows the first line. Since the dialogue can branch or loop, there is no way to preview the entire dialogue in the timeline preview. In playmode, the whole dialogue chain is played from the given node.

4. Implement your own Dialogue UI as per need. (Check Samples for demonstration)
### Skipping dialogue:
`DialogueSystem.Instance.ToggleSkip()`

# Contribution
https://github.com/Studio-23-xyz/com.studio23.ss2.dialoguesystem/blob/main/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.studio23.ss2.dialoguesystem",
"version": "0.4.14",
"version": "0.4.15",
"displayName": "Dialogue System",
"description": "Dialogue system is an authoring tool for developers to integrate dialogue from scriptwriters inside unity.",
"unity": "2022.3",
Expand Down
48 changes: 39 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
Dialogue System is an open source package for dialogue in your game. It supports:
1. Dialogue Choices
2. Unity localization support
3. Custoom editor
3. Custom editor for easily writing lines. No need to wrangle with the localization UI.
4. Node based UI
5. Timeline support

![Dialogue Graph](Screenshots/2.png)
![View](Screenshots/3.png)

## Table of Contents

1. [Installation](#installation)
2. [Usage](#usage)


## Installation

### Install via Git URL
Expand All @@ -29,16 +28,47 @@ https://github.com/Studio-23-xyz/com.studio23.ss2.dialoguesystem.git#upm
## Usage

### Using Dialogue System
1. Create a dialogue graph.
2. `DialogueManager.Instance.StartDialogue(graph)`
Samples contain an example of a helper monobehavior that keeps a reference to a graph and allows starting dialogues from there.

1. Access the Wizard from top toolbar Studio-23 > Dialogue System > Dialogue System Wizard
### Dialogue Graph Rules:
1. Must have at least one startnode. If you have multiple startnodes, please read the corresponding section.
2. If anything can be connected, you can connect them.

2. Follow the process in the Wizard to create your Dialogue Graphs.
### Adding UI
The sample scene contains example UI. You can create your own UI by using the following events in `DialogueSystem.cs`:
```
public event Action<bool> OnSkipToggled;
public event Action<DialogueGraph> OnDialogueStarted;
public event Action<DialogueGraph> OnDialogueEnded;
public event Action<DialogueChoicesNode> OnDialogueChoiceStarted;
public event Action<DialogueChoicesNode> OnDialogueChoiceEnded;
```
### Multiple Startnodes in graph:
By default it takes the first startnode it finds. If you have multiple start nodes, this is unreliable. In this case, pass the specific startnode you want to start with.
```
DialogueSystem.Instance.StartDialogue(DialogueNodeBase node);
```
Or:
```
DialogueSystem.Instance.PlayDialogue(DialogueNodeBase node);
```
The node can be any node, not just a startnode. The samples contain a helper class with a custom editor that will help you pick startnodes if you have multiple.

3. Add the Dialogue Manager Singleton in your Scene
### Timeline Support
The samples contain examples of timeline support with custom timeline clips utilizing the dialogue system. You'll need to have:
1. A DialogueManager active in the scene
2. Assign a DialogueUI to the track.

4. Implement your own Dialogue UI as per need. (Check Samples for demonstration)
The samples contain an example DialogueUI base class. The base class isn't required for the rest of the package but required for timeline support. Any UI that ingherits it can be assigned to the track.

# Contribution
https://github.com/Studio-23-xyz/com.studio23.ss2.dialoguesystem/blob/main/CONTRIBUTING.md
Note: Editor preview for dialogue clips only shows the first line. Since the dialogue can branch or loop, there is no way to preview the entire dialogue in the timeline preview. In playmode, the whole dialogue chain is played from the given node.

### Skipping dialogue:
`DialogueSystem.Instance.ToggleSkip()`

# Contribution
https://github.com/Studio-23-xyz/com.studio23.ss2.dialoguesystem/blob/main/CONTRIBUTING.md

0 comments on commit 7b8f24a

Please sign in to comment.