animancer icon indicating copy to clipboard operation
animancer copied to clipboard

No dropdown for nested property

Open mrkvinter opened this issue 1 year ago • 2 comments

Environment

  • Animancer Version Number: 7.4.2
  • Animancer Pro or Lite: Both
  • Unity Version: 2022.3.4f
  • Platform: Windows

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)

mrkvinter avatar Aug 27 '23 11:08 mrkvinter

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 avatar Aug 27 '23 13:08 KybernetikGames