Mustenaka / AdaptorPhysX

A deformable object(softbody, cloth, rope) implemented in Unity3d, which uses PBD algorithm with Unity Jobs(ECS / DOTS) and has an extensible computing structure
Apache License 2.0
21 stars 0 forks source link

Unity 2022 inspector Bug #1

Open Mustenaka opened 11 months ago

Mustenaka commented 11 months ago

When i try to visualize constraint constraint parameters in the Inspctor interface, there are some bugs in the rendering that can actually affect the display and debugging of the values because the Constraint is a generic design.

Unity 2022.3.13 LTS inspctor editor error. his bug does not appear in older 2019 versions.

influence An error occurs when the normalized serialization parameters are displayed.

Mustenaka commented 11 months ago

Test code:

ABase.cs

namespace Temp.ComponentInspectorTest
{
    [System.Serializable]
    public class ABase
    {
        public enum Type
        {
            A1Class,
            A2Class,
        }

        public Type type;
    }
}

A1Class.cs

namespace Temp.ComponentInspectorTest
{
    [System.Serializable]
    public class A1Class :ABase
    {
        public string a1Value;
    }
}

A2Class.cs

namespace Temp.ComponentInspectorTest
{
    [System.Serializable]
    public class A2Class : ABase
    {
        public int a1Value;
    }
}

B

using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

namespace Temp.ComponentInspectorTest
{
    /// <summary>
    /// Temp component, use for A
    /// </summary>
    public class B : MonoBehaviour
    {
        [SerializeReference] public List<ABase> a = new List<ABase>();

        private void Start()
        {
            a.Add(new A1Class());
            a.Add(new A2Class());
            a.Add(new A1Class());
        }

        private void OnDisable()
        {
            if (a != null)
            {
                a.Clear();
            }
        }
    }
}
Mustenaka commented 11 months ago

2022 Error.

2030c3419c14d7b273a77d630d5dc7fd

2019 No Error be40cfdb2136d148e70096df49b4a49a

Mustenaka commented 11 months ago

Ready to override draw Inspector solution, independent of [SerializeReference]

Mustenaka commented 10 months ago

PS: this bug same as macOS and Windows