/// <summary> /// Saves the XML document. /// </summary> public static void SaveXml() { using (XmlWriter writer = XmlWriter.Create(Paths.CreateOSPath("settings.xml"), XmlWriterSettings)) { writer.WriteStartDocument(); writer.WriteStartElement("Options"); writer.WriteStartElement("General"); writer.WriteElementString("AutoSave", AutoSave.ToString()); writer.WriteElementString("AutoSaveSpeed", AutoSaveSpeed.ToString()); writer.WriteElementString("AutoScroll", AutoScroll.ToString()); writer.WriteElementString("Music", Music.ToString()); writer.WriteElementString("NpcBar", NpcBar.ToString()); writer.WriteElementString("NpcDamage", NpcDamage.ToString()); writer.WriteElementString("NpcName", NpcName.ToString()); writer.WriteElementString("PlayerBar", PlayerBar.ToString()); writer.WriteElementString("PlayerDamage", PlayerDamage.ToString()); writer.WriteElementString("PlayerName", PlayerName.ToString()); writer.WriteElementString("SavedAccount", SavedAccount); writer.WriteElementString("SavedPassword", SavedPassword); writer.WriteElementString("Sound", Sound.ToString()); writer.WriteElementString("SpeechBubbles", SpeechBubbles.ToString()); writer.WriteElementString("Timestamps", Timestamps.ToString()); writer.WriteElementString("ActiveSkin", ActiveSkin); writer.WriteElementString("LastClientUpdateTime", LastClientUpdateTime.ToBinary().ToString()); writer.WriteElementString("LastGFXUpdateTime", LastGFXUpdateTime.ToBinary().ToString()); writer.WriteEndElement(); writer.WriteStartElement("ConnectionInfo"); writer.WriteElementString("Port", ConnectionPort.ToString()); writer.WriteElementString("Server", ConnectionIP); writer.WriteElementString("UpdateLink", UpdateAddress); writer.WriteElementString("SFXLink", SoundAddress); writer.WriteElementString("MusicLink", MusicAddress); writer.WriteEndElement(); writer.WriteStartElement("Editor"); writer.WriteElementString("MapGrid", MapGrid.ToString()); writer.WriteElementString("DisplayAttributes", DisplayAttributes.ToString()); writer.WriteElementString("DragAndPlace", DragAndPlace.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); writer.WriteEndDocument(); } }
// Start is called before the first frame update void Start() { //get Points manager to assign points upon correct shot points = GameObject.Find("PointsManager").GetComponent <Points>(); //Assign SpeechBubbleManager that already exists in scene to this face. Finally. speechScript = GameObject.Find("SpeechBubbleManager").GetComponent <SpeechBubbles>(); shooter = speechScript.shooter; //Create desired drink desiredSpray = (Drinks)Random.Range(0, 6); Debug.Log("I want " + desiredSpray); //Pass drink into Speech function to actually instantiate it speechBubbleObject = speechScript.Speech(desiredSpray, this.gameObject); }
public void Awake() { Instance = this; }