Hello,
I am using a webplayer interface to load a game on my server when a button is clicked. Everything seems to be going well (no errors), but the new webplayer game never loads/starts. Am I missing something in the code below? Or is it due to the webplayer I am trying to load (ie: does it need to be a streamed webplayer etc)?
using UnityEngine;
using System.Collections;
public class InterfacerB : MonoBehaviour {
void OnGUI()
{
if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 10, 100, 25), "Load Game 1"))
{
StartCoroutine("StartLoad");
Debug.Log("Clicked to load");
}
}
IEnumerator StartLoad () {
WWW stream =
new WWW ("http://www.faskoona.com/mature/m_content/content01/WebPlayer/WebPlayer.unity3d");
while (!stream.isDone) {
Debug.Log("Loading");
yield return null;
}
stream.LoadUnityWeb();
}
}
Any help is greatly appreciated!