Example #1
0
	/// <summary>
	/// Loads the status.
	/// </summary>
	/// <param name="reader">Reader.</param>
	protected override void LoadStatus (XmlReader reader)
	{
		base.LoadStatus (reader);
		reader.ReadToNextSibling ("Mana");
		mana.value = reader.ReadElementContentAsFloat ();
		Debug.Log("Found Exp field: " + reader.ReadToNextSibling ("Exp"));
		Debug.Log("Found level field: " + reader.ReadToNextSibling ("Level"));

		GetComponent<Inventory> ().LoadInventory (reader);
		reader.ReadEndElement ();
	}
Example #2
0
	protected void LoadPosition(XmlReader reader) {
		reader.ReadToFollowing ("Position");
		reader.ReadToDescendant ("x");
		Vector3 loadedPosition = new Vector3 ();
		loadedPosition.x = reader.ReadElementContentAsFloat ();
		reader.ReadToNextSibling ("y");
		loadedPosition.y = reader.ReadElementContentAsFloat ();
		reader.ReadToNextSibling ("z");
		loadedPosition.z = reader.ReadElementContentAsFloat ();
		transform.position = loadedPosition;
		reader.ReadEndElement ();
	}