Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by diabloroxx · Jul 19, 2010 at 07:28 PM · webplayersaveloadxmlbrowser

Save/Load game using XML on Browser/Web Player

I am currently working on the ways to store the location and tags of the game objects online and trying to load them dynamically on calling them. I looked into this XML wiki - http://unifycommunity.com/wiki/index.php?title=Save_and_Load_from_XML and am using the JavaScript included there. The script works properly when I run it in the editor and also as a stand alone app. But it doesn't work on the browser. Should I rewrite the script to actually use WWW to load the xml file or am I doing something wrong? Am currently using the script with its File IO The Application.dataPath for some reason does not work with the web browser.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
7
Best Answer

Answer by diabloroxx · Aug 02, 2010 at 04:06 PM

For all other new users who want to know what I did to use XML on web player-

I loaded the XML file using the WWW class to load the URL.

function LoadXML()
{
var url = "http://localhost/unity/sample.xml";
var www = new WWW(url);
while(!www.isDone)
{
yield WaitForSeconds(1);
}
yield www;
var _info : String = www.data;
_data=_info;
}

For writing back to the XML, I had to write a PHP file and called it using the WWWForm.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image abi-kr01 · Feb 24, 2014 at 11:38 AM 0
Share

when i try this code on my unity window works fine but when i build the same code it just hang up the browser is three any way i can solve that problem

avatar image
1

Answer by Eric5h5 · Jul 19, 2010 at 07:39 PM

You can't use local file I/O in the web player for security reasons.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image diabloroxx · Jul 19, 2010 at 08:02 PM 0
Share

Yeah. I figured that out. Are there any other methods to do this on the web player without using too much resource? All that I need to do is, get number of objects and the tags with location to display them on the screen. The user can modify location on screen though.

avatar image Eric5h5 · Jul 19, 2010 at 08:19 PM 0
Share

@diabloroxx: you can use the WWW class and get WWW.data.

avatar image abi-kr01 · Feb 25, 2014 at 09:25 AM 0
Share

how to put my generated xml to web server

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

Saving Game Problem 1 Answer

Load XML File ? 1 Answer

Xml Saving and Loading Problems 1 Answer

Save and Load from XML U3 Collections Problem 1 Answer

Save and load arrays into an XML file 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges