# LoadFromFile(string)

> Load the GraphicsStateCollection at the given path.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Experimental.Rendering](/engine/6000.3/script-reference/unityengine/experimental/rendering.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public bool LoadFromFile(string filePath)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Location of the GraphicsStateCollection file.

### Returns

| Type                                                          | Description                                                      |
| ------------------------------------------------------------- | ---------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the collection was successfully loaded, false otherwise. |

### Remarks

The file extension of GraphicsStateCollection is \*.graphicsstate.

```csharp
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: [GraphicsStateCollection.SaveToFile](/engine/6000.3/script-reference/unityengine/experimental/rendering/graphicsstatecollection/savetofile.md).
