unity3d-native-plugins

In Unity BuildPostProcessor, how exactly do you, simply, “copy over” one file?

≡放荡痞女 提交于 2019-12-08 03:09:44
问题 in Unity I simply have a file, afile.ts, sitting in Assets/ In the built Xcode, I simply want it to be sitting in the project folder (really, anywhere is fine) included in the project. You do this using project.AddFileToBuild(g, something something something); But I plain can not figure it out . (Obviously it is totally undocumented at Unity.) How is it done? Just the one simple file - actually copy it from Assets/filename to the Xcode project (and it will have target membership and be in the

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

不问归期 提交于 2019-12-07 12:44:40
问题 Say you have a low-level Unity plugin for iOS, So in c# using System.Runtime.InteropServices; using AOT; public class Teste: MonoBehaviour { [DllImport("__Internal")] private static extern void set_texture_from_unity(System.IntPtr texture, int w, int h); have a texture, .Apply() it, and then send the pointer to the native iOS plugin: public void ClickPassTexture() { tex = new Texture2D(256, 256, TextureFormat.ARGB32, false); tex.filterMode = FilterMode.Point; tex.Apply(); // ACTUALLY UPLOAD

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

眉间皱痕 提交于 2019-12-05 19:48:47
Say you have a low-level Unity plugin for iOS, So in c# using System.Runtime.InteropServices; using AOT; public class Teste: MonoBehaviour { [DllImport("__Internal")] private static extern void set_texture_from_unity(System.IntPtr texture, int w, int h); have a texture, .Apply() it, and then send the pointer to the native iOS plugin: public void ClickPassTexture() { tex = new Texture2D(256, 256, TextureFormat.ARGB32, false); tex.filterMode = FilterMode.Point; tex.Apply(); // ACTUALLY UPLOAD TO GPU someMaterial.mainTexture = tex; set_texture_from_unity( tex.GetNativeTexturePtr(), tex.width, tex