I'm working on integrating an API on a WebGL project, and I need to pass an array of strings to a native plugin. Here's a snippet of my native plugin code in **JavaScript**:
WebGetValues: function(textIds)
{
opt_params = {};
var ids = {};
for (var i = 0; i < textIds.length; i++)
{
ids.push(Pointer_stringify(textIds[i]));
console.log(Pointer_stringify(textIds[i]));
}
}
I'm not seeing a console log, which leads me to believe that it's either not being passed in as an array or the data is invalid. Here's how I'm passing in the string array from **C#**:
public void GetValues(IEnumerable textIds)
{
#if UNITY_WEBGL && !UNITY_EDITOR
WebGetValues(textIds.ToArray());
return;
#endif
}
I couldn't find anything in the [documentation](https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html) or anywhere online about passing in string arrays to native JS plugins. Is there a way to do this?
↧