> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/scene-fusion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfprefablocker.md).

# Class sfPrefabLocker

Namespace: [KS.SceneFusion.Client.Unity.Editor](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor.md)\
Assembly: KSUnity-Source.dll

Prevents saving of prefabs when [AllowSavingPrefabs](#ks_scenefusion_client_unity_editor_sfprefablocker_allowsavingprefabs) is false.

```csharp
public class sfPrefabLocker : AssetModificationProcessor
```

#### Inheritance

object ← AssetModificationProcessor ← [sfPrefabLocker](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfprefablocker.md)

## Properties

### AllowSavingPrefabs <a href="#ks_scenefusion_client_unity_editor_sfprefablocker_allowsavingprefabs" id="ks_scenefusion_client_unity_editor_sfprefablocker_allowsavingprefabs"></a>

If false, prevents prefabs from being saved.

```csharp
public bool AllowSavingPrefabs { get; }
```

#### Property Value

bool

## Methods

### AllowSave(string) <a href="#ks_scenefusion_client_unity_editor_sfprefablocker_allowsave_system_string" id="ks_scenefusion_client_unity_editor_sfprefablocker_allowsave_system_string"></a>

Allows the prefab at the given path to be saved. This must be called before saving the prefab each time you want it to be saved.

```csharp
public void AllowSave(string path)
```

#### Parameters

`path` string

Prefab path to allow to be saved.

### Get() <a href="#ks_scenefusion_client_unity_editor_sfprefablocker_get" id="ks_scenefusion_client_unity_editor_sfprefablocker_get"></a>

```csharp
public static sfPrefabLocker Get()
```

#### Returns

[sfPrefabLocker](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sfprefablocker.md)

Singleton instance

### OnWillSaveAssets(string\[]) <a href="#ks_scenefusion_client_unity_editor_sfprefablocker_onwillsaveassets_system_string" id="ks_scenefusion_client_unity_editor_sfprefablocker_onwillsaveassets_system_string"></a>

Called before assets are saved. Prevents saving prefabs if [AllowSavingPrefabs](#ks_scenefusion_client_unity_editor_sfprefablocker_allowsavingprefabs) is false.

```csharp
public static string[] OnWillSaveAssets(string[] paths)
```

#### Parameters

`paths` string\[]

Paths to assets being saved.

#### Returns

string\[]

Paths to save.

### Start() <a href="#ks_scenefusion_client_unity_editor_sfprefablocker_start" id="ks_scenefusion_client_unity_editor_sfprefablocker_start"></a>

Starts preventing prefabs from being saved.

```csharp
public void Start()
```

### Stop() <a href="#ks_scenefusion_client_unity_editor_sfprefablocker_stop" id="ks_scenefusion_client_unity_editor_sfprefablocker_stop"></a>

Stops preventing prefabs from being saved.

```csharp
public void Stop()
```
