/DDialog

Primary LanguageC#

D'Dialogue System

ddialoguethumb

D'Dialogue System by DoublSB, MIT LICENCE.

한글로 문서를 보고 싶은 경우, 이 링크로 이동하세요. 링크

Installation

  1. Import D’Dialogue System.
  2. Find the ‘DialogAsset’ prefab which in Asseet/DialogAsset/Prefab folder.

image

  1. Move the ‘DialogAsset’ prefab to the scene which you want.

image

  1. Move the ‘Character’ prefab to the DialogAsset/Characters.

image

image

Basic Example

  1. Set the sprite you want to display to Emotion -> Normal.

image

  1. Change gameobject name to your character name.

image

  1. The basic setup is complete! Get DialogManager and call method ‘Show’!

image

  • Using Doublsb.Dialog namespace.
  • Create new dialogData. Input two parameters, text, character name.
  • Call Show method with created DialogData.

Commands

You can use various commands just by editing the text. image

All commands begin and end with slash character. ( / )

Speed

Adjusting text speed.

command description
/speed:up/ Reducing text delay by 0.25 seconds.
/speed:down/ Increasing text delay by 0.25 seconds.
/speed:init/ Changing text delay to initial value.
/speed:(float)/ Changing text delay to float value.

Size

Adjusting size within the text.

command description
/size:up/ Increasing text size by 10.
/size:down/ Decreasing text size by 10.
/size:init/ Changing text size to initial value.
/size:(int)/ Changing text size to int value.

Click

Pause the printing until the window is clicked.

command description
/click/ Pause the printing until the window is clicked.

Close

Forces the window to close without interaction.

command description
/close/ Forces the window to close without interaction.

Wait

Pause the printing for amount of time.

command description
/wait:(float)/ Pause the printing for amount of time.

Color

Change color within the text.

command description
/color:(Color Name)/ Change color with supported color names. Check out ‘Supported colors’ in Unity’s official documentation. link
/color:(Hex Code)/ Change color with hex code. Ex) /color:#1fcbfc/

Emote

Change the character’s sprite while printing text.

command description
/emote:(emote name)/ Change the character sprite with emote name.

If you want to add new emotions to your character, follow the steps.

  • Open the inspector of character which you want to add emotions.

image

  • Enter the emotion’s name and click create.

image

  • Change new emotion’s sprite.

image

  • Use emote command to display new emotion.

image

Sound

Play the sound while printing text.

command description
/emote:(sound name)/ Play the sound with sound name.

If you want to play sound, you need to set Call SE. Follow the steps.

  • Open the inspector of character and add sound object.

image

  • Now we can use sound command with sound object’s name.

image

Selection

image

image

image

You can display choice items in the dialogue. Add a choice item to the SelectList of the DialogData class. Use callbacks to make the dialogue react differently depending on the result.

Other Settings

Setting Chat SE

image

If you add Chat SE, sound will be play for each delay. This feature allows you to make different chat sounds for each character. If you set multiple ‘Chat Se’, one of the sounds will be play randomly for each delay.

Callback

image

You can set callback when the window is hidden. When the message is over and the window is clicked, the window is hidden. After that, the callback is invoked.

Setting Skippable

image

If you set ‘isSkippable’ to false, users cannot skip text even if you click on the window.

Default text size

image

Set DialogData.Format.DefaultSize to change default text size.

Default print delay time

image

Set default delay time at Dialog Manager inspector.