Hi everyone,

I'm using Unity 3D field to add the Unity web player into my Drupal site.
It's working well, but now I'm trying to make the web page and the web player communicate and I don't know how to achieve this.

First I tried the tutorial Unity with SendMessage() and ExternalCall() to make a simple html page and the web player share data and it worked.

But I don't know how to do the same with Drupal, in my Basic page I have a Unity3d field with my .unity3d loaded but:
-The Unity3d field doesn't provide me a "Unity3d" instance which I could use to SendData() and I don't know how to retrieve it.
-My web page which should receive data from my Unity web player is never called:

In Unity:

Application.ExternalCall("UnityCalledMe");

In The web page javascript:

function UnityCalledMe()
{
 alert("Unity called me");
}

The alert never pop.

I searched in Unity's and Drupal's forum and I didn't find anything related to my problem.

Thank you for your time,
Best regards,
Alexandre.

EDIT 05/18/2015

Finally I found the solution while hosting the site on the cloud:

1) I used a simple file field (no need of Unity 3D field) and allowed unity3d files, uploaded my file, used the link provided (eg: http://yourWebstie.devcloud.acquia-sites.com/sites/default/files/UnityWe...)

2) I extracted the basic Unity web player creation script from the .html create by unity and simply put it in the body of my basic page and allowed format full html and I used the previous url to init Unity:

 u.initPlugin(jQuery("#unityPlayer")[0], "http://yourWebstie.devcloud.acquia-sites.com/sites/default/files/UnityWebPlayer.unity3d");

And now as I have my unity instance I can use SendMessage(), and the when the web player code calls ExternalCall(), my web page function are called.

I'm not sure that is the best way to achieve want I wanted to do, but it works using the default unity's html code with very few changes and not overriding Drupal or using static pages.

Hope it will help if someone have this problem.

I'm always open to best way to solve my problem.

Best regards,
Alexandre.