Skip to content
No description, website, or topics provided.
Objective-C++ C# Swift Objective-C C
Branch: master
Clone or download
Latest commit 03ff05e Aug 27, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Assets feat: Code format and added function to ask permision of photo library. Aug 27, 2019
Packages first commit. Aug 13, 2019
ProjectSettings first commit. Aug 13, 2019
.gitignore first commit. Aug 13, 2019
README.md Update README.md Aug 27, 2019

README.md

Save a Unity generated texture as MTLTexture in native

This project is a plugin of Unity. It is purpose to save a texture generated by Unity in native.

How to use

Copy Plugin/iOS/ folder to your project in your plugin folder. You might also use NativeTextureSaver.cs. It is good start point to use or to custom this plugin.

Main implementation of this plugin is void _SaveTextureImpl(unsigned char* mtlTexture, const char* objectName, const char* methodName).

Define the function in any class you want to use it. That like below.

using System.Runtime.InteropServices; // Needs this to use "DllImport".

[DllImport("__Internal")]
static private extern void _SaveTextureImpl(System.IntPtr texture, string objectName, string methodName);

Then, you can call the function as C# method like below.

// You need setting up a render texture before use it.
_SaveTextureImpl(_renderTexture.GetNativeTexturePtr(), gameObject.name, nameof(CallbackMethod));
You can’t perform that action at this time.