question

alireza95 avatar image
alireza95 asked

executecloudscript unity Function Parameter

I am using the unity sdk version of playfab and i want to run a cloud script. when want to make a request like this

 ExecuteCloudScriptRequest request =
            new ExecuteCloudScriptRequest() {FunctionName = "updateHighScore",FunctionParameter = "{highScore : 10}"};
I dont know the correct way to set the function parameter since its just an object but the cloud scripts can have multiple input parameters at first i guessed a json format but i didn't find any documentation on this
apisunity3dsdksCloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Andy avatar image
Andy answered

Check out the documentation here: https://api.playfab.com/docs/tutorials/landing-automation/writing-custom-cloud-script. It has a unity sample that passes an input string value to cloudscript. The specific verbiage is:

ExecuteCloudScriptRequest.FunctionParameter can be any object, able to be serialized to json.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Andy avatar image Andy ♦♦ commented ·

In your specific example, you could do something like:

FunctionParameter = new { highScore = 10 }
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.