Skip to content

Read Only Field

Paulo edited this page Jul 31, 2021 · 1 revision

Description

The show if attribute easily provides the functionality of making fields only readable through the inspector. Take a look at the example below.

Usage

[SerializeField, ReadOnlyField]
private int number = 10;

This will make it so that the number field is greyed-out and only readable in the inspector.

Showcase

Showcase Image

Clone this wiki locally