• RuntimesUnity
  • what is the better option-mixing sfx in spine than export unity

or mix it in unity itself
cause i just finished to export-animating and coding my job and i realize i forgot the mixing sfx
does it fine to mixing in unity ,i just can import sfx only, or dump it all and have to start it all over again

    Related Discussions
    ...

    rmx I may not understand exactly what "mixing sfx" means, but by adding audio events during animation in Spine, you can specify the name of the sfx file to be played and when it should start playing. See the Spine User Guide for more information: https://esotericsoftware.com/spine-events#Audio-node

    rmx does it fine to mixing in unity ,i just can import sfx only, or dump it all and have to start it all over again

    Please explain what you mean by this sentence, otherwise we can't help. As requested in the past multiple times, please take more time to write clear questions in the first place. It also helps to use proper punctuation.

    If you are having troubles expressing yourself in English, note that you can write questions in your native language. The forum provides a "translate" button which any reader can use to translate the text to their own language.

    • rmx replied to this.

      Harald I mean literally putting sound effects on the animation
      I put the animation in Unity before I put the sound on and coded it to play to see if it worked well
      But on second thought, when Spine puts sound into animation, they asked me if I have to do all the work I did at Unity all over again, or if it's possible to reduce work by adding only sound mixing related data on top of that

      @rmx Thanks for the clarification, the term "mixing" was confusing at first.

      You can react to audio events in spine-unity like normal events:
      https://esotericsoftware.com/spine-unity#Processing-AnimationState-Events
      In code you register your callback method as follows:

      skeletonAnimation.AnimationState.Event += HandleEvent;
      ..
      
      void HandleEvent (TrackEntry trackEntry, Event ev) {
         if (!string.IsNullOrEmpty(ev.Data.AudioPath))
             yourSoundManager.PlaySoundForName(ev.Data.AudioPath, ev.Data.Volume, ev.Data.Balance);
      }

      Here yourSoundManager.PlaySoundForName() could look up the audio file name in a map and play the respective audio asset with the given settings. If you modify volume and balance per event, instead of ev.Data.Volume you would then use ev.Volume.