Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

Search the Community

Showing results for tags 'xml'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
    • Example Projects
    • Scripts
    • Shaders
    • Unity Tutorials
    • FPS Kit Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
    • Sell
    • Request
  • Mars' Modular Multiplayer Photon FPS Kit's Topics
  • Mars' Modular Multiplayer Photon FPS Kit's Reviews
  • Mars' Modular Multiplayer Photon FPS Kit's Updates
  • Mars' Modular Multiplayer Photon FPS Kit's Tutorials
  • Busy People's Introductions
  • Photon's Tutorials
  • Photon's Photon General
  • Photon's Showcase


  • Free Projects
  • Free Assets
  • Game Demos
  • Photon's Files

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL





YouTube URL

Facebook URL

Twitter URL

IndieGoGo URL

Kickstarter URL


GreenLight URL



Found 2 results

  1. hey guys, i trying to make shop for my game with xml, right now i hawe working database... the isue i need put all shop item by hand and set its value inside hierarchy script, if i hawe hundresds of items, each item hawe 11 diferent variables as stats, its litle bit time consuming :D. i need that program would it self find all objects and put it to list, then get all values (int's and float's) from xml file and attack it to list. using UnityEngine; using System.Collections; using System.Collections.Generic; using System.Xml; using System.Xml.Serialization; using System.IO; public class XMLserialize : MonoBehaviour { public static XMLserialize ins; public GameObject player; public ItemDatabase itemDB; void Awake () { ins = this; } private void PreloadPlayerItemsToList (){ } public void SaveItems (){ XmlSerializer serializer = new XmlSerializer(typeof(ItemDatabase)); FileStream stream = new FileStream (Application.dataPath + "/StreamingAssets/Xml/item_Data.xml", FileMode.Create); serializer.Serialize (stream, itemDB); stream.Close (); } public void LoadItems (){ XmlSerializer serializer = new XmlSerializer (typeof(ItemDatabase)); FileStream stream = new FileStream (Application.dataPath + "/StreamingAssets/Xml/item_Data.xml", FileMode.Open); itemDB = serializer.Deserialize (stream) as ItemDatabase; stream.Close (); } void PrepareToBuy (){ SaveItems (); } public void EditDatabaseEntries (int ThisId){ itemDB.list[ThisId].boughtStatus = true; SaveItems (); } } [System.Serializable] public class ItemEntry { // ginklo info listas public string gunName; public string gunType; public int price; public int spriteId; public bool boughtStatus; public int damage; public int clipSize; public float accuracy; public float fireRate; public float Weight; public float reloadSpeed; } [System.Serializable] public class ItemDatabase { //clases itemEntry info listu masyvas [XmlArray("Weapons")] public List<ItemEntry> list = new List<ItemEntry>(); void start (){ foreach (GameObject gun in GameObject.FindGameObjectsWithTag ("gun")) { //list.Add (gun); //this is where my issue } } } as you can see itemenry class is item stats that will be in list. itemdatabase class is list it slef, i can put items as gameobjects but that prompts error. (i did that in end of the script with foreach x.x) how to get all objects from hierarchy and stats then put everything to damn list thank you
  2. How to saving and reading data in XML file? I am referring mainly to save the coordinates of objects and load them when loadnig a game. I am writting in C#.
  • Create New...