There is a line SendMessage('MyGameObject', 'MyFunction'); what should be in the receiving function?
Hi to all, make the game for web in unity. there is a line SendMessage('MyGameObject', 'MyFunction',3); which passes the value from HTML page in unity("Object","Function",the Value(can be empty)). The question that should be in this function?
The arguments can be anything, depends on your needs. Drive in both directions json and you will be happy. The receiving function should be something like this : MyFunction(string arg)
earline.Fad answered on June 14th 19 at 18:34
Nothing special. It should be a public function called MyFunction in a script on the object name MyGameObject.
If you pass the parameter must be a parameter of the function. as far as I remember only accepts a string. Therefore, the parameter must be of type string