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
0
Question by Tinawchen · Jan 04, 2012 at 10:57 PM · buttonsavexmlonclick

onclick save in xml

Hi :) I need your help please, because, i have a button, "save" and if the user clicks on this button, it should save the scene in an xml data,…. how can i do this? or is it possible?

xoxo Tina

Comment
Add comment · Show 1
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 basil · Dec 19, 2012 at 01:33 AM 0
Share

Hi everyone!

Is it posible to make scenes using X$$anonymous$$L?

what i mean is Create buttons using xml and read X$$anonymous$$L in runtime to make that Button and display in scene.. and so on..

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by flamy · Jan 05, 2012 at 05:56 AM

It is completely possible in unity and there are various way to do it!!

if ur game is for Standalone, no much trouble implementing it, you can just use xmlTextwriter and xmlTextReader functions from system.xml namespace .After this you just have to call the functions of this class...

If it is not for standalone and ur platform doesnt support using dll, you have to write your own xml reader and writer according to ur neeed in this case you can use streamReader and streamWriter to save and retrieve data.

If your level data is not much ( may be 50 or so variables) you can check the playerPrefs to save them it would be straight forward approach..

Comment
Add comment · Show 5 · 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 CHPedersen · Jan 05, 2012 at 07:43 AM 0
Share

The xmltextwriter and xmltextreader classes are stream based, which is preferable if the file is large (>1mb), because you can stream the data a little bit at a time over several frames, (or in a separate thread) so you won't obstruct the rendering. But if the file is small, you don't need to stream it asynchronously. You can construct the entire file with System.Xml.XmlDocument, and call XmlDocument.Save(string path) to save the file to disk. This is synchronous - it blocks until the saving completes. But XmlDocument is easier to work with in code when you build the X$$anonymous$$L.

avatar image flamy · Jan 05, 2012 at 09:08 AM 0
Share

ya i agree with christian but i wont be preferring to use the xml unless the data is too complicated because the X$$anonymous$$L is not all that fast to begin with and unity provides playerPrefs, which is good for a limited amount of data!

but i wont deny what you have said, it is true.

avatar image Tinawchen · Jan 05, 2012 at 11:07 PM 0
Share

thank you all, great information :D thank you thank youuu <3, buuuuuuuuut, im a complete newbie in c# and unity and do you have any hints for program$$anonymous$$g it?

thank you soo much tinaa

avatar image Tinawchen · Jan 05, 2012 at 11:18 PM 0
Share

okay, new problem, its not saving the scene in an xml, …. i'm working on 5 drop down fields, where you can choose from 6 choices each.

And i have to save now, with an save button, those choices who were picked in the drop downs, in an xml,…… so its only text,……..!

complicated,… how can i do this????

xoxo Tinaa

avatar image basil · Dec 19, 2012 at 01:34 AM 0
Share

Hi everyone!

Is it posible to make scenes using X$$anonymous$$L?

what i mean is Create buttons using xml and read X$$anonymous$$L in runtime to make that Button and display in scene.. and so on..

avatar image
0

Answer by $$anonymous$$ · Jan 26, 2012 at 06:47 PM

I think in the blog unitynoobs have a sample that you need http://unitynoobs.blogspot.com/2011/04/xml-writing-to-existing-xml-file.html

Comment
Add comment · 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

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Saving/Loading Vertices Efficiently 2 Answers

My Function is not showing up in the OnClick Menu 2 Answers

UI Button not working 2 Answers

Random.Range 0 Answers

Putting a delay in a button OnClick ? (Javascript) 3 Answers


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