Can you write to a Unity texture, from an iOS C plugin, “on the spot”?

眉间皱痕 提交于 2019-12-05 19:48:47

Solution in the "new" Unity

The (legendary) Keijiro Takahashi from Unity Japan, has posted probably the single most important thing ever posted from Unity:

https://github.com/keijiro/TextureUpdateExample

An actual example of the (new) frame-wise style texture-updating from plugin.

AND IT WORKS WITH IOS

Again, all that can be said is this pretty much the most valuable thing ever emitted from Unity! Phew!


Regarding the question as asked, I really have never found the solution.

You need to call UpdateExternalTexture method.

Updates Unity texture to use different native texture object.

This function is mostly useful for native code plugins that create platform specific texture objects outside of Unity, and need to use these textures in Unity Scenes. For a texture created with CreateExternalTexture, this function switches to another underlying texture object if/when it changes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!