D
D
Danil Afanasiev2017-06-18 18:31:26
JavaScript
Danil Afanasiev, 2017-06-18 18:31:26

Vkontakte and unity3D, can anyone explain how to link apivk and unity?

Hello. I have a vk application created on unity.
Can anyone explain how to link apivk and unity? Did I do it right?
1) Added the following code to index.html:

function post()
 {

 VK.api("wall.post", {"message": "Ура! Оно работает!РАБОТАЕТ!"}, function (data) {
alert("Post ID:" + data.response.post_id);
});

 }

function friends()
 {
   
 VK.callMethod("showInviteBox");

 }

2. Added the "friends" button in the project and by clicking on its function:
public void friends()
  {
    #if UNITY_WEBGL
    Application.ExternalCall("friends");
    #endif
  }
.
Added a "public" button in the project and by clicking on its function:
public void post()
  {
    #if UNITY_WEBGL
    Application.ExternalCall("post");
    #endif
  }

How to do it differently? Platform - webgl.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danil Afanasiev, 2017-06-19
@danil_afan

flight-dream.com/forum/index.php?topic=425.0 answer.

A
Ayu12, 2020-07-18
@Ayu12

Hi , above methods mentioned for working in index.html worked ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question