Experimental: this API is experimental and might be changed or removed in the future.

GraphicsStateCollection.SaveToFile

Declaration

public bool SaveToFile(string filePath);

Parameters

filePath Output location of GraphicsStateCollection serialized data.

Returns

bool Returns true if collection successfully saved, false otherwise.

Description

Save GraphicsStateCollection to disk.

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); } }

Did you find this page useful? Please give it a rating: