animancer
animancer copied to clipboard
No dropdown for nested property
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:
Fact:
(no foldout)
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;