Page 3 of 4

Re: Tweening characters as they appear in the scene

Posted: Sun May 26, 2019 7:55 am
by Tony Li
Hi,

Sorry for the delay. I was tied up with other support requests yesterday. I'm working on it now.

Re: Tweening characters as they appear in the scene

Posted: Sun May 26, 2019 2:11 pm
by AoF
Thank you! :D

Re: Tweening characters as they appear in the scene

Posted: Sun May 26, 2019 2:17 pm
by Tony Li
Here's the Spine Support package:

DS_Spine_Support_2019-05-26.unitypackage

(Exported from Unity 2018.3.0)

It uses standard Spine animation; you don't have to use Mecanim for the Spine animation.


To set it up:

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. It will be activated as needed during conversations.

3. In your Standard Dialogue UI, replace the StandardUISubtitlePanel components with SpineSubtitlePanel components.

That should take care of the basics.


To tween in/out:

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 DialogueActor component.


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, [trackIndex], [loop], [subject])

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

Code: Select all

SpineAnimation(wave);
SpineAnimation(bow,0,false,listener)@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.

Re: Tweening characters as they appear in the scene

Posted: Sun May 26, 2019 2:25 pm
by AoF
Tony Li wrote: Sun May 26, 2019 2:17 pm It uses standard Spine animation; you don't have to use Mecanim for the Spine animation.
I was going to request that, but I thought I'd burdened you too much as it is and I could have lived with mecanim. Thank you, though! I have a feeling that it's better this way.

Now excuse me while I rate your libraries 5 stars :P

Re: Tweening characters as they appear in the scene

Posted: Sun May 26, 2019 2:34 pm
by Tony Li
Thanks! :D

If you notice any issues or have any feature requests for the Spine support package, just let me know.

Re: Tweening characters as they appear in the scene

Posted: Sun May 26, 2019 9:24 pm
by AoF
Documenting as I go to help others:

You should leave the portrait image field blank in your subtitle panels and remove the actual portrait image game objects since they won't be used.

The Dialogue example depends on the Spine examples, so make sure the Dialogue asmdef references the example code if you're using asmdefs. Spine doesn't behave nicely when you import code that refers to it and the asmdef doesn't reference Spine: This removed all the actor SkeletonData asset fields so I had to add them back manually (I may have made a mistake here, since I can't tell what they were, but I assumed all actors were spineboy-unity_SkeletonData.

I have some questions:

I have this warning on the player's Hidden animation, but I don't know if it matters: Image

Is the subtitle panel visibility dropdown only used for the display names now, or does it do other things?

Re: Tweening characters as they appear in the scene

Posted: Mon May 27, 2019 8:47 am
by Tony Li
Thanks for these notes. I'll add them to the manual in the next release.
AoF wrote: Sun May 26, 2019 9:24 pmI have this warning on the player's Hidden animation
It doesn't matter in this case, but the answer is that I copied the original subtitle panel's animator controller and forgot to replace that animation. The original animation assumes the panel has a Canvas Group component and sets its Alpha to zero. You could replace it with an animation that immediately positions the Spine character out of view if you want. Or you can position the character out of view at design time and ignore the Hidden animation.
AoF wrote: Sun May 26, 2019 9:24 pmIs the subtitle panel visibility dropdown only used for the display names now, or does it do other things?
It's technically used for all UI elements assigned to the subtitle panel, but if your subtitle panels are sharing the same UI elements then the elements that are shared will stay visible.

Re: Tweening characters as they appear in the scene

Posted: Mon May 27, 2019 3:37 pm
by AoF
Tony Li wrote: Mon May 27, 2019 8:47 am It's technically used for all UI elements assigned to the subtitle panel, but if your subtitle panels are sharing the same UI elements then the elements that are shared will stay visible.
Ah, that's really helpful to know. Is there any place in the documentation that describes the visibility dropdown options in detail? As you can see from my other reply, that's been a source of confusion for me. I don't really understand what all the options do, and that video that shows the VN dialogue UI doesn't explain every option there is.

Re: Tweening characters as they appear in the scene

Posted: Mon May 27, 2019 4:35 pm
by Tony Li
AoF wrote: Mon May 27, 2019 3:37 pmIs there any place in the documentation that describes the visibility dropdown options in detail?
Kind of. It's documented in code, which means this API page has a table that describes the options. I'll add a similar table to the Dialogue UIs manual page in the next version.

Re: Tweening characters as they appear in the scene

Posted: Mon May 27, 2019 6:40 pm
by AoF
Cool. A link to that may suffice because it makes sense to me.