SaveToFile(string)
Save GraphicsStateCollection to disk.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Experimental.Rendering
- Assembly: UnityEngine.CoreModule
public bool SaveToFile(string filePath)
Parameters
Output location of GraphicsStateCollection serialized data.
Returns
Type | Description |
|---|---|
| bool | Returns true if collection successfully saved, false otherwise. |
Remarks
The file extension of GraphicsStateCollection is *.graphicsstate.
using UnityEngine;using UnityEngine.Experimental.Rendering;public class SaveToFileExample : MonoBehaviour{ public GraphicsStateCollection graphicsStateCollection; public string filePath; void Start() { graphicsStateCollection = new GraphicsStateCollection(); graphicsStateCollection.BeginTrace(); } void OnDestroy() { graphicsStateCollection.EndTrace(); graphicsStateCollection.SaveToFile(filePath); }}
Additional Resources: GraphicsStateCollection.LoadFromFile, GraphicsStateCollection.SendToEditor.