|
Hello, I would like to use the GUI button to load a new game file in a webplayer. The documentation for WWW.LoadUnityWeb and most WWW is in Javascript only for some reason, and I could not find any good examples. I am a bit new at coding so be nice please :) Below is the basic button I would be using: using UnityEngine; using System.Collections; public class interface1 : MonoBehaviour { void OnGUI(){ if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 10, 100, 25), "Load Game 1")) Debug.Log("Clicked to load"); } } Thank you!
(comments are locked)
|
|
Here is the example translated into C#. Instead of using "Start," It uses a coroutine "StartLoad". So in your GUI Button, call StartCoroutine(StartLoad); The stuff with the guiTexture is not important, it's used to display a loading bar. Thank you very much! Appreciate the help. BTW do you think that Unity has forgotten to add the C# and Boo versions of the WWW documentation pages, or is this intentional?
Oct 10 '10 at 10:03 PM
Faskoona
It looks like they probably just forgot about this page.
Oct 11 '10 at 12:31 AM
Adam Rademacher
(comments are locked)
|
