Spine Support

This page describes how to set up the Dialogue System with Esoteric Software's Spine. (Spine is required.)

Spine copyright © Esoteric Software.

Setup

Import Packages

To enable Dialogue System integration:

  1. Import Esoteric Software's Spine-Unity package: http://esotericsoftware.com/spine-unity-download
    The integration depends on scripts in this package. The integration's example scene depends on the example assets in this package.
  2. Import the package Third Party Support ► Spine Support. This will unpack files into the folder Assets ► Pixel Crushers ► Dialogue System ► Third Party Support ► Spine Support.

If you use assembly definition files, make sure the integration's code can access the Spine-Unity package's assembly.

Scene Setup

To set up your scene:

  1. Add a SpineDialogueActor component to your character's GameObject. This can be an empty GameObject. It doesn't have to be the Spine character.
  2. Add your Spine character to the scene, and assign it to the SpineDialogueActor's Spine GameObject field. You can deactivate the Spine character if you want. The SpineDialogueActor component will activate it as needed during conversations.
  3. In your Standard Dialogue UI, replace the StandardUISubtitlePanel scripts with SpineSubtitlePanel scripts. To replace a script while keeping its field assignments, use the triple-bar menu in the upper right of the Inspector to switch to Debug mode. Then drag SpineSubtitlePanel into the StandardUISubtitlePanel's Script field. Finally, switch the Inspector back to Normal mode.
    • Unassign the panel's Portrait Image field and remove the actual portrait image GameObjects since they won't be used.

Additional Setup Options

Tween Spine Characters In/Out

To tween characters in/out of view, or otherwise animate their arrival and exit:

  1. Add an Animator to the character's GameObject (the same one that has the SpineDialogueActor component). Add Show and Hide triggers that tween the Spine character in and out. (See the example scene.)
  2. Assign the Show and Hide trigger names to the SpineDialogueActor component.

Additional Animations

To play additional animations:

  1. Add a SpineSequencerReferences component to the character's GameObject. Assign the Spine character to the Skeleton Animation field, and assign Spine animations to the Animation Reference Assets list.
  2. Use the new SpineAnimation() sequencer command:

SpineAnimation(animationName, [subject], [trackIndex], [loop])

Parameters:

  • animationName: Name of an animation asset in the subject's SpineSequencerReferences component.
  • subject: (Optional) Spine GameObject with a SpineSequencerReferences component. Default: speaker.
  • trackIndex: (Optional) Track index to use. Default: 0.
  • loop: (Optional) Loop or not. Default: true.

Example:

SpineAnimation(wave);
SpineAnimation(bow,listener,0,false)@1

This example loops the "wave" animation on the speaker. At the 1-second mark, it plays the "bow" animation one time on the listener.


<< Third Party Integration