protected void Start() { panelBrowser = GetComponent <Browser>(); panelBrowser.RegisterFunction("go", args => { DemoNav(args[0].Check()); }); demoBrowser.onLoad += info => { panelBrowser.CallFunction("setDisplayedUrl", demoBrowser.Url); }; demoBrowser.Url = demoSites[0]; }
public void Start() { HUDBrowser = hud.GetComponent <Browser>(); HUDBrowser.RegisterFunction("unpause", args => Unpause()); HUDBrowser.RegisterFunction("quit", args => Application.Quit()); Unpause(); #if UNITY_STANDALONE_LINUX StartCoroutine(Rehide()); #endif //Update coin count on hud when user gets one PlayerInventory.Instance.coinCollected += count => HUDBrowser.CallFunction("setCoinCount", count); }
public void HandleDialog(BrowserNative.DialogType type, string text, string promptDefault = null) { if (type == BrowserNative.DialogType.DLT_HIDE) { Hide(); return; } Show(); // Debug.Log("HandleDialog " + type + " text " + text); switch (type) { case BrowserNative.DialogType.DLT_ALERT: dialogBrowser.CallFunction("showAlert", text); break; case BrowserNative.DialogType.DLT_CONFIRM: dialogBrowser.CallFunction("showConfirm", text); break; case BrowserNative.DialogType.DLT_PROMPT: dialogBrowser.CallFunction("showPrompt", text, promptDefault); break; case BrowserNative.DialogType.DLT_PAGE_UNLOAD: dialogBrowser.CallFunction("showConfirmNav", text); break; case BrowserNative.DialogType.DLT_PAGE_RELOAD: dialogBrowser.CallFunction("showConfirmReload", text); break; case BrowserNative.DialogType.DLT_GET_AUTH: dialogBrowser.CallFunction("showAuthPrompt", text); break; default: throw new ArgumentOutOfRangeException("type", type, null); } }
/** Changes the color of the box on the page by calling a function in the page. */ public void ChangeColor() { var color = colors[colorIdx++ % colors.Length]; browser.CallFunction("changeColor", color.r, color.g, color.b, "Selection Number " + colorIdx).Done(); }
public void SetCode(string liveCode) { browser.CallFunction("setCode", liveCode); }