Monday 2 March 2015

SketchUp Models in Unity with Xml


Unity Web Player. Install now!

I created an application with Unity which allows you to walk around and view the models I made in SketchUp up close. Clicking on an object shows more information about it. This information is loaded from Xml files embedded into Unity.

2 things to take note:

  1. You need to download and install the Unity Web Player in order to use the application
  2. The web player doesn't on Google Chrome at the moment. Use other browsers like FireFox or Internet Explorer instead.


To see the cursor again, press [Esc].

Here are some screenshots for those who can't use the application:





2 comments:

  1. Hello there,
    Let me offer a possible solution to the loading xml issue.
    1. Save your xml into the Assets/Resources directory (eg File1.xml)
    2. Load the xml as a text asset
    TextAsset ta=Resources.Load("File1"); // note, no extension
    string theString=ta.text;
    3. Use xml string as usual (deserialise, load into xml-doc, etc)
    4. Test in web player, it should be fine

    ReplyDelete
    Replies
    1. I have no problem with the xml. I loaded the xml as a TextAsset. The problem is getting the Unity player to play the project. I used dropbox to store the html and Unity3D. But while I was able to get the web player, I kept getting the "file corrupted" error.

      Delete