# UpdateExternalTexture(nint)

> Updates Unity texture to use different native texture object.

## Definition

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

## UpdateExternalTexture(IntPtr)

```csharp
public void UpdateExternalTexture(nint nativeTex)
```

### Parameters

**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): Native 2D texture object.

### Remarks

This function is mostly useful for [native code plugins](/engine/6000.7/manual/scripting/compilation-and-code-reload/plug-ins/native-plugin-interface.md) that create platform specific texture objects outside of Unity, and need to use these textures in Unity Scenes. For a texture created with [Texture2D.CreateExternalTexture](/engine/6000.7/script-reference/unityengine/texture2d/createexternaltexture.md), this function switches to another underlying texture object if/when it changes.

Additional Resources: [Texture2D.CreateExternalTexture](/engine/6000.7/script-reference/unityengine/texture2d/createexternaltexture.md).
