Often the Texture2D API is needed but texture represents the Texture class (or just Texture2D type is needed).
Testing status
No unit tests have been added.
Performance tested in Editor, Win86 and Win64 builds using Stopwatch.
Manual testing status
Tested using Editor
Comments to reviewers
It uses Native Ptr, so please check that in different builds (Android/iOS should work, but not tested). The API Refference for Native Ptr says the following:
"On platforms that do not support native code plug-ins, this function always returns NULL."
It's hard to say which platforms do so. In case of coming accross that issue, I know a slow but convenient solution with Blitting like here:
https://answers.unity.com/questions/1298366/rawimagetexture-to-texture2d.html
Purpose of this PR
Often the Texture2D API is needed but texture represents the Texture class (or just Texture2D type is needed).
Testing status
Manual testing status
Tested using Editor
Comments to reviewers
It uses Native Ptr, so please check that in different builds (Android/iOS should work, but not tested). The API Refference for Native Ptr says the following: "On platforms that do not support native code plug-ins, this function always returns NULL." It's hard to say which platforms do so. In case of coming accross that issue, I know a slow but convenient solution with Blitting like here: https://answers.unity.com/questions/1298366/rawimagetexture-to-texture2d.html
Native Ptr API ref: https://docs.unity3d.com/ScriptReference/Texture.GetNativeTexturePtr.html