Search Unity

Link to Website for Android and iOS

Discussion in 'Immediate Mode GUI (IMGUI)' started by pryor110, Jul 25, 2017.

  1. pryor110

    pryor110

    Joined:
    Jan 8, 2017
    Posts:
    5
    Hello,

    I have been searching all over for a way to bring up a webpage in Unity for mobile. I found a plugin but it doesn't support Android and iOS. Is there a solution for this? I'd like to bring up a simple page and a Google Maps page.
     
  2. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,066
    PHL1 likes this.
  3. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    Here is a simple implentation:
    Code (CSharp):
    1. // --------------------------------------------------------------------------------------------------------------------
    2. // <copyright file="WebInterface.cs" company="Supyrb">
    3. //   Copyright (c) 2017 Supyrb. All rights reserved.
    4. // </copyright>
    5. // <author>
    6. //   Johannes Deml
    7. //   send@johannesdeml.com
    8. // </author>
    9. // --------------------------------------------------------------------------------------------------------------------
    10.  
    11. using UnityEngine;
    12. using System.Collections;
    13.  
    14. namespace Supyrb
    15. {
    16.     public class WebInterface : MonoBehaviour
    17.     {
    18.  
    19.         public void OpenWebsite(string url)
    20.         {
    21.             Application.OpenURL(url);
    22.         }
    23.     }
    24. }
    With that script it is really easy to use it with ui:
    upload_2017-8-28_10-2-25.png
     
    smock_74 likes this.