codewriter-packages / Tri-Inspector

Free inspector attributes for Unity [Custom Editor, Custom Inspector, Inspector Attributes, Attribute Extensions]
MIT License
989 stars 48 forks source link

Does not work for children of NetworkBehaviour #150

Open ryzhovalex opened 10 months ago

ryzhovalex commented 10 months ago

Describe the bug For classes inherited from Unity.Netcode.NetworkBehaviour no attributes are drawn.

For other classes, even in the same assembly, even inherited from other abstract classes (which in turn are inherited from MonoBehaviour) works fine.

Maybe the error is not connected with NetworkBehaviour, or Unity did some nasty things there, or the error is mine, don't know :)

Expected behavior Drawn attributes, as usual.

Code Sample

using TriInspector;
using Unity.Netcode;
using UnityEngine;

public class Test: NetworkBehaviour
{
    [SerializeField]
    private bool isSynced = false;

    [InfoBox(
        "oh no",
        TriMessageType.Warning
    )]
    [SerializeField]
    [EnableIf(nameof(isSynced))]
    private int syncActionType;
}

Screenshots image

Desktop: Windows 11 Unity version: 2023.2.4f1 Tri Inspector version: 1.13.2