Version: 2021.2

NonReorderableAttribute

class in UnityEngine

/

继承自:PropertyAttribute

切换到手册

描述

Disables reordering of an array or list in the Inspector window.

By default, array or list script variables are presented with a UI control that allows array element reordering via drag handles to the left of element content. You can use [NonReorderable] attribute on a script array or list variable to disable this. When reordering is disabled, the Inspector shows arrays or lists with a simple UI control that has an array size followed by array elements.

using UnityEngine;

public class NonReorderableAttributeTest : MonoBehaviour { [NonReorderable] public int[] array; }

继承的成员

变量

order可选字段,用于指定多个 DecorationDrawer 应采用的绘制顺序。