diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/README.md b/Assets/Packages/com.studio23.ss2.dialoguesystem/README.md index 31ffc33..94bb5b7 100644 --- a/Assets/Packages/com.studio23.ss2.dialoguesystem/README.md +++ b/Assets/Packages/com.studio23.ss2.dialoguesystem/README.md @@ -2,9 +2,13 @@

-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 @@ -12,7 +16,6 @@ Dialogue System is a package created for tooling Silent Scream 2 Game. However i 1. [Installation](#installation) 2. [Usage](#usage) - ## Installation ### Install via Git URL @@ -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 OnSkipToggled; + + public event Action OnDialogueStarted; + public event Action OnDialogueEnded; + + public event Action OnDialogueChoiceStarted; + public event Action 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 \ No newline at end of file diff --git a/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json b/Assets/Packages/com.studio23.ss2.dialoguesystem/package.json index 5857730..d4fa232 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.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", diff --git a/README.md b/README.md index 1b9a244..94bb5b7 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ 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 @@ -16,7 +16,6 @@ Dialogue System is an open source package for dialogue in your game. It supports 1. [Installation](#installation) 2. [Usage](#usage) - ## Installation ### Install via Git URL @@ -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 OnSkipToggled; + + public event Action OnDialogueStarted; + public event Action OnDialogueEnded; + + public event Action OnDialogueChoiceStarted; + public event Action 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 \ No newline at end of file