Open offline web pages in a browser window by clicking a button?

Hi all,

I currently have a game where the user can click on buttons to open up web pages, I use the following script on the button for this…

public void OpenURL(string url)
         {
             Application.OpenURL(url);
         }
     }

The URL is then put into the box that this script produces in the inspector and works perfectly.

However what I would now like to do is open the pages OFFLINE instead, so people without an internet connection can see the information.
The way I envisage doing this is to save the web pages so they can be opened up locally in a browser offline.
However I am stumped as to how to tell the button to open the relevant file and open it - is there a way of doing this? Maybe save the web page file in a local folder and point the button to that file?

This would be way easier that the only alternative I can think of - to save each web page as an image and have them open up as an image popup within the game as opposed to in the browser (there are a lot, so I would rather not have to do this!)

This is for PC Standalone only.

Any help would be greatly appreciated.

Thanks in advance!

Problem Solved -

  • Add a folder into the build folder and put all the files you want to be opened in there

  • Change the Open URL script to say

    public void relativeURL(string url)

  • Now put ‘dirname/filename’ in the URL field

Hey presto - it now works!