KybernetikGames / animancer

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

No dropdown for nested property #307

Closed mrkvinter closed 6 days ago

mrkvinter commented 12 months ago

Environment

Description

If we have class with signle nested class/struct with ClipTransitions, we get always expanded property.

Reproduction

Steps to reproduce the bug: For example, we have struct with seviral clip

[Serializable]
struct Clips { 
    public ClipTransition Clip1;
    public ClipTransition Clip2;
    public ClipTransition Clip3;
}

And put in to MonoBehaviour

class Example : MonoBehaviour {
    public Clips clips;
}

Expected: image

Fact: image (no foldout)

KybernetikGames commented 12 months ago

Hiding the foldout is an intentional feature for Transition Assets since their transition field is the only thing in their Inspector so it might as well be always expanded, but obviously it shouldn't apply in this case.

To fix it, open TransitionDrawer.cs and change the start of the InitializeMode method to this:

        protected void InitializeMode(SerializedProperty property)
        {
            if (_Mode == Mode.Uninitialized)
            {
                if (property.depth > 0)
                {
                    _Mode = Mode.Normal;
                    return;
                }

                _Mode = Mode.AlwaysExpanded;
KybernetikGames commented 1 month ago

Animancer v8.0 is now available for Alpha Testing and includes this fix..

KybernetikGames commented 6 days ago

Animancer v8.0 is now fully released.