![Essential Attributes [Lockable]](https://assetstorev1-prd-cdn.unity3d.com/key-image/e43ebefe-5605-4259-be6a-15826588ae7c.jpg)
Lock serialized fields in the Inspector with a padlock button to prevent unwanted edits — works with arrays, lists, and individual fields.The [Lockable] attribute adds a clickable padlock icon next to any serialized field in the Inspector. Once locked, the field becomes read-only, protecting it from unintended changes — perfect for shared or sensitive data.It works on any serialized field, including arrays and lists, with additional control to lock:Only the array container (arraySize, ➕/➖)Only the elementsOr both (via the ArrayTarget parameter)When a list is locked, Unity’s default controls like ➕, ➖, and drag-and-drop are hidden or disabled — making the list truly non-editable in the Inspector.The locking is purely visual and non-persistent: the field returns to its locked state after reloads or recompilation, ensuring a safe-by-default editing experience.💡 Try Before You BuyThis attribute is also included in the Essential Attributes asset — or try [ElementName]and [TexturePreview] for free on the Unity Asset Store.🔒 Adds a padlock icon to serialized fields to toggle editability🧩 Works with any serializable type: primitives, Unity objects, structs, custom classes, etc.🧮 Compatible with arrays and lists🎛️ ArrayTarget enum to control lock scope:・Array (array size & buttons)・Elements・Both🧱 When locked:・Fields are grayed out・arraySize is not editable・➕/➖ buttons are hidden・Drag & drop is blocked🔁 Lock state resets automatically on script reload or scene change🚫 Does not block runtime or scripted changes — Inspector-only🧠 Ideal for reducing accidental edits and improving team safety⚠️ Internal UsageReflectionCustomEditor (UnityEngine.Object)