Answer the question
In order to leave comments, you need to log in
How to properly deintegrate json in Unity received with SendMessage?
Here is the code in index.html:
<script type="text/javascript">
var script = document.createElement('SCRIPT');
script.src = "https://api.vk.com/method/users.get?user_ids=210700286&fields=bdate&v=5.68&callback=callbackFunc";
document.getElementsByTagName("head")[0].appendChild(script);
function callbackFunc(result) {
var name = result.response[0].first_name
}
</script>
<script type = "text/javascript" language = "javascript" >
function inform()
{
gameInstance.SendMessage('vkconnect', 'Prin', name)
}
</script>
public void Prin(string arg)
{
//Textname.text = arg;
}
Answer the question
In order to leave comments, you need to log in
You need to parse json into a format that is understandable to sharp. You can do this with the built-in JsonUtility , or you can download any of the million json parsers and use it. There is something on the Assett Store , but many parsers live on github or their own site.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question