KybernetikGames / animancer

Documentation for the Animancer Unity Plugin.
68 stars 8 forks source link

Does "Transition Libraries" support multiple layers in v8.01 ? #361

Closed fechen2 closed 2 months ago

fechen2 commented 2 months ago

Hello, I upgraded the plugin to v8.0 and found the new feature of "Transition Libraries". But, I not sure I can use this feature for my animation which had multiple layers (upperbodyLayer, additiveLayer).

V8.0 AnimancerComponent:

        public AnimancerState Play(ITransition transition)
            => Graph.Layers[0].Play(transition);

I found this fixed baselayer.

v7 AnimancerComponent:

        public AnimancerState Play(AnimancerState state)
            => Playable.Play(state);  

AnimancerPlayable (which can get layer):

        public AnimancerState Play(AnimancerState state)
        {
            return GetLocalLayer(state).Play(state);
        }

Does "Transition Libraries" support multiple layers in v8.01 ? Or I need write a new Play function like v7?

KybernetikGames commented 2 months ago

Transition Libraries should work fine with layers when you use animancer.Layers[x].Play(...) same as before.

The code you quoted is only for animancer.Play(...) where you don't specify a layer it now always uses 0 instead of maybe using 0 or maybe staying on another layer if the state already existed. That has nothing to do with Transition Libraries, its just a general simplification.

fechen2 commented 2 months ago

Thank you for your reply.