| Parameter | Description |
|---|---|
| filePath | Location of the GraphicsStateCollection file. |
Boolean True if the collection was successfully loaded, false otherwise.
Load the GraphicsStateCollection at the given path.
The file extension of GraphicsStateCollection is *.graphicsstate.
Note: The Web platform doesn't support this function as the file system is not accessible.
using UnityEngine; using UnityEngine.Experimental.Rendering;
public class LoadFromFileExample : MonoBehaviour { public GraphicsStateCollection graphicsStateCollection; public string filePath;
void Start() { graphicsStateCollection = new GraphicsStateCollection(); if (graphicsStateCollection.LoadFromFile(filePath)) { Debug.Log("graphicsStateCollection contains " + graphicsStateCollection.totalGraphicsStateCount + " graphics states."); } } }
Additional resources: SaveToFile.