Simple Prefab Lock System for Unity EditorSimple Prefab Lock System for Unity Editor (Unity 2019+)LockedPrefabTools is a lightweight editor utility that prevents accidental modifications to Prefab Instances in the Unity Editor. With a single click in the Hierarchy, you can lock or unlock an entire prefab instance.This tool is especially useful for UI layouts, level prefabs, and any shared prefab structure frequently touched by multiple team members—helping prevent the all-too-common “Who broke the prefab again?” situations.✅ Supported Unity Versions: Unity 2019.4 or later⭐ Key Features✔ Lock / Unlock Icon in the HierarchyDisplays a Lock / Unlock icon next to Prefab Instance Root GameObjects.Clicking the icon toggles the lock state immediately.Icon texture and color change based on the current lock state.✔ Lock the Entire Prefab Instance Hierarchy (Root + Children)When locked, every GameObject in the prefab instance is set to HideFlags.NotEditable, preventing:Moving / deleting objects in the HierarchyModifying components in the InspectorChanging child object structureThis enforces the intention: “Do not modify this prefab” at the editor level.✔ Automatic Lock Inheritance From Parent PrefabsIf any parent transform has an active LockedPrefabInstance, children are automatically treated as locked and do not display a separate icon.Locking the parent protects the entire nested hierarchy.✔ Automatic Settings Asset (ScriptableObject)When the asset is imported, a Settings ScriptableObject is created automatically.Access via: Tools → Locked Prefab Tools → SettingsYou can customize:Lock / Unlock icon texturesIcon colorsYou can easily replace the icon style to match your project theme.✔ Editor-Only — No Runtime ImpactWorks only inside the Unity Editor.Does not affect builds, performance, or runtime behavior.🛠 Installation & Usage1. InstallationImport the asset into your project under Assets/LockedPrefabTools/.Unity automatically generates LockedPrefabSettings.asset.Access the settings: Tools → Locked Prefab Tools → Settings2. How to UseSelect a Prefab Instance Root placed in the scene.In the Hierarchy, a lock icon appears on the right side of the item.Click the icon:Unlocked → Locked Adds or enables the LockedPrefabInstance component and locks the entire hierarchy.Locked → Unlocked Disables the component and unlocks the hierarchy.

