How To Separate Json Parameter Function to get values i need ?

Hello i just found that i can’t send more than one parameter to a Json Function so i did array of string to send to the function parameter

object[] tempStorage = new object[2];
                             tempStorage[0] = ExpName;
                             tempStorage[1] = ExpName + pdfName;
                        
                             Application.ExternalCall("OpenPDFUIButton", tempStorage);

in json file how to be able to separate those 2 values to get the value i want

 function OpenPDFUIButton (expNameAndFileName)
{
var PName = "http://21.32.56/Virtual/Files/"+expName+"/"+expNameAndFileName;
}

Never saw that method before (and it says its obsolete) but as you function probably is JavaScript, I guess

function OpenPDFUIButton (names)
{
var PName = "http://21.32.56/Virtual/Files/"+names[0]+"/"+names[1];
}

should do the trick?

i will try it it

are you sure of this Answer ?

Absolutely not!

based on the documentation: Unity - Scripting API: Application.ExternalCall

  • First off this is an obsolete way to call JS functions. There’s a better way here: Unity - Manual: Interaction with browser scripting
  • You probably want to make your argument a string[ ] instead of an object[ ]. The docs seem to suggest that other types besides what it lists will be sent as the ToString() method of that object. ToString() of object[ ] is probably not what you want.