void OnMessageFromJS(string jsMessage)
 {
     if (jsMessage.Equals("ping"))
     {
         Debug.Log("Ping message received!");
         InAppBrowser.ExecuteJS(javaScriptCode);
         InAppBrowser.CloseBrowser();
     }
 }
 private void Update()
 {
     if (isOpen)
     {
         if (Input.GetKeyDown(KeyCode.Escape))
         {
             isOpen = false;
             InAppBrowser.CloseBrowser();
         }
     }
 }
Beispiel #3
0
    void OnMessageFromJS(string jsMessage)
    {
        Debug.Log(jsMessage + "message received!");

        if (jsMessage.Equals("moto"))
        {
            regresarPanel.gameObject.SetActive(true);

            RefriContainer.gameObject.SetActive(false);
            TvContainer.gameObject.SetActive(false);
            LaptopContainer.gameObject.SetActive(false);

            MotoActivation();
            InAppBrowser.CloseBrowser();
        }
        if (jsMessage.Equals("laptop"))
        {
            RefriContainer.gameObject.SetActive(false);
            TvContainer.gameObject.SetActive(false);
            MotoContainer.gameObject.SetActive(false);

            regresarPanel.gameObject.SetActive(true);
            LaptopActivation();
            InAppBrowser.CloseBrowser();
        }
        if (jsMessage.Equals("refri"))
        {
            MotoContainer.gameObject.SetActive(false);
            TvContainer.gameObject.SetActive(false);
            LaptopContainer.gameObject.SetActive(false);

            regresarPanel.gameObject.SetActive(true);
            RefriActivation();
            InAppBrowser.CloseBrowser();
        }
        if (jsMessage.Equals("tv"))
        {
            RefriContainer.gameObject.SetActive(false);
            MotoContainer.gameObject.SetActive(false);
            LaptopContainer.gameObject.SetActive(false);

            regresarPanel.gameObject.SetActive(true);
            TvActivation();
            InAppBrowser.CloseBrowser();
        }
    }