Hi all,
Wondering if anyone knows if it is possible to send a C# struct through the JNI as a parameter.
I have a setup that is like this:
public struct FileStruct
{
public string path;
public long byteOffset;
public long assetLength;
}
public class PluginClass{
public override void DoSomethingNative(FileStruct[] files)
{
pluginClass.Call("doSomethingNative", files);
}
}
Then on the android side I have the same struct defined as:
package com.my.packagename;
public class FileStruct {
public String path;
public long byteOffset;
public long assetLength;
}
public class PluginClass{
public void doSomethingNative(FileStruct[] assets) {
for (FileStruct asset : assets) {
Log.i(TAG, "doSomethingNative: path: "
+ asset.path
+ " byteOffset: "
+ asset.byteOffset
+ " assetLength: "
+ asset.assetLength);
}
}
}
Currently this throws the error: ```Exception: JNI: Unknown signature for type ‘FileStruct’ (obj = FileStruct) equal
at UnityEngine._AndroidJNIHelper.GetSignature (System.Object obj) [0x00356] in <3c22a197ab60454cb70124c69f2248be>:0
…
Is there any way to get something like this to work?? Do I need to create the AndroidJavaObject manually in C#?