<div id="vk_comments"></div>
<script type="text/javascript" language="javascript">
VK.Widgets.Comments('vk_comments', {limit: 7, width: '627', attach: '*', pageUrl: "https://vk.com/appппппппппп"});
</script>
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using System;
namespace SafingLoading
{
public class SafingLoading : MonoBehaviour
{
public Text Textname;
public Text Textlastname;
public Slider slider;
public int Level;
private int slidV;
private float timer;
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
slider.value = slidV;
timer += 6 * Time.deltaTime;
if (timer >= 2)
{
slidV += 7;
timer = 0;
}
if (slider.value >= 100)
{
SceneManager.LoadSceneAsync(Level);
//#if UNITY_WEBGL
//Application.ExternalCall("inform");
//#endif
}
}
}
[Serializable]
public class MyJson : SafingLoading
{
public string id;
public string first_name;
public string last_name;
public string bdate;
public void FixJson(string name)
{
}
}
}
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="https://vk.com/js/api/xd_connection.js?2" type="text/javascript"></script>
<script type="text/javascript">
VK.init(function() {
// API initialization succeeded
// Your code here
}, function() {
// API initialization failed
// Can reload page here
}, '5.64');
</script>
<script src="Build/UnityLoader.js"></script>
<script>
var gameInstance = UnityLoader.instantiate("gameContainer", "Build/runner.json");
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];
console.log(name);
gameInstance.SendMessage('vkconnect', 'FixJson', name );
}
</script>
</head>
<body>
<script type = "text/javascript" language = "javascript" >
function friends()
{
VK.callMethod("showInviteBox");
}
</script>
</script>
<script type = "text/javascript" language = "javascript" >
function opublicovat()
{
VK.api("wall.post", {"message": "Hello!"}, function (data) {
alert("Post ID:" + data.response.post_id);
});
}
</script>
<div id="gameContainer" style="width: 960px; height: 600px; margin: auto"></div>
</body>
</html>
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using System;
public class SafingLoading : MonoBehaviour
{
public Slider slider;
public int Level;
private int slidV;
private float timer;
public Text Textname;
public Text Textlastname;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update()
{
slider.value = slidV;
timer += 6 * Time.deltaTime;
if (timer >= 2)
{
slidV += 7;
timer = 0;
}
if (slider.value >= 100)
{
#if UNITY_WEBGL
Application.ExternalCall("inform"); //Вызов функции информ, которая в свою очередь вызывает ('MyGameObject', 'Prin',3)
#endif
}
}
public void Prin(string arg)
{
//Вопрос, как сделать так что-бы переменная Textname была равна переданному параметру?
}
}