codewriter-packages / Tri-Inspector

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

Ignore readonly fields #164

Closed TsFreddie closed 4 months ago

TsFreddie commented 4 months ago

I believe Unity does not serialize readonly fields.

I've checked in Unity 2022.3.32f using this really simple script.

using UnityEngine;
public class Test : MonoBehaviour
{
    public readonly int ReadonlyValue = 1;
    public int Value = 2;
}

Unity: image

TriInspector (1.14.0): image

Debug (for reference): image