Hello!
I'm currently at the stage of my game where a lot of things has been done, and I gotta hack my way around...
Here is my situation: I have lots of conversation across my game, and I have been using the sequencer command "AnimatorPlay(animationName, animatorTarget, transition duration)" extensively
It works great but now I'm finding myself in a specific need: I want to call a specific function in one of my game scripts when the AnimatorPlay is called, and another function when the duration of the transition has passed.
My first guess was to try and modify (reluctantly, but I dont see any other solution) Sequencer.cs, more specifically the method "HandleAnimatorPlayInternally", and call my stuff just before animator.CrossFadeInFixedTime(...)
However here is my problem: I cannot manage to reference my own script in Sequencer.cs (or any other DS scripts). I'm guessing this is due to assembly definitions, but I unfortunately have no experiences with this and I am having trouble finding how can I reference my script there!
To go a bit more in details about WHY im doing this:
My characters are animated a specific way, with their body and faces all animated in single clips. The faces are 2D sprites that are animated with constant values. However when transitioning to another clip, the value used for the 2D sprites is blending too, so it create very weird motions. My goal is to completely prevent any blending whatsoever as soon as a "AnimatorPlay" is called, and resume the transition after the duration of the crossfade. Other animation cases like gameplay and cutscene are already handled another way, but I still need to find a solution for animations triggered from dialogue sequences.
This is a very specific problem, and probably not DS specific tho, but I'm still asking in case you can help
Modyfing Sequencer.cs
Modyfing Sequencer.cs
Currently working on ->Squeakross: Home Squeak Home<- Using Dialogue System Save System and other features.
Previous game made with Dialogue system ->The Spirit and The mouse<-
Previous game made with Dialogue system ->The Spirit and The mouse<-
Re: Modyfing Sequencer.cs
Hi,
Scripts in Plugins folders can't see files that are outside Plugins. Unity compiles code in several separate passes, in this order:
What about writing your own sequencer command? For example, duplicate SequencerCommandAnimatorPlayWait.cs and call it something like SequencerCommandAnimate.cs. Modify it to prevent blending. Then use the Dialogue Editor's Database > Global Search & Replace to replace all "AnimatorPlay(" with "Animate(".
Scripts in Plugins folders can't see files that are outside Plugins. Unity compiles code in several separate passes, in this order:
- Assembly-CSharp-firstpass: Files in Plugins, except for Editor folders
- Assembly-CSharp-firstpass-editor: Files in Plugins that are in Editor folders (not included in builds)
- Any folders with assembly definition files (none by default unless you or an asset has added them)
- Assembly-CSharp: Files outside Plugins, except for Editor folders
- Assembly-CSharp-editor: Files outside Plugins that are in editor folders (not included in builds)
What about writing your own sequencer command? For example, duplicate SequencerCommandAnimatorPlayWait.cs and call it something like SequencerCommandAnimate.cs. Modify it to prevent blending. Then use the Dialogue Editor's Database > Global Search & Replace to replace all "AnimatorPlay(" with "Animate(".
Re: Modyfing Sequencer.cs
As always thanks for the great reply Tony,
I will do a copy of AnimatorPlayWait and do a global search & replace, it does sounds like the more reasonable option!
I will do a copy of AnimatorPlayWait and do a global search & replace, it does sounds like the more reasonable option!
Currently working on ->Squeakross: Home Squeak Home<- Using Dialogue System Save System and other features.
Previous game made with Dialogue system ->The Spirit and The mouse<-
Previous game made with Dialogue system ->The Spirit and The mouse<-