# Save(bool)

> Saves the current state of the ScriptableSingleton.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
protected virtual void Save(bool saveAsText)
```

### Parameters

**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): If true then the file is saved as text, if false it is saved as binary.

### Remarks

Call `Save` to save the current state of the ScriptableSingleton to disk for persistence. If you call this function and your class has no [FilePathAttribute](/engine/6000.7/script-reference/unityeditor/filepathattribute.md), then saving has no effect.

**Note**: Don't call this method from [ScriptableObject.OnValidate()](/engine/6000.7/script-reference/unityengine/scriptableobject/onvalidate.md) because the singleton can be in the process of reading its data from a file, which causes an error.

Additional Resources: [ScriptableSingleton\<T>.GetFilePath()](/engine/6000.7/script-reference/unityeditor/scriptablesingleton1/getfilepath.md).
