void IXmlSerializable.WriteXml(XmlWriter writer) { if (ToneInterval != null) { writer.WriteAttributeString("toneInterval", ToneInterval.ToString()); } if (ToneDuration != null) { writer.WriteAttributeString("toneDuration", ToneDuration.ToString()); } writer.WriteString(Digits); }
// PLAYS A SPECIFIC TONE public void PlayTone(string instrument, ToneDuration duration, MusicTone tone, int octave) { string toneClipName = instrument + Underline + duration.ToString() + Underline + tone + Underline + octave; Debug.Log(toneClipName); ToneInfo info = new ToneInfo() { Tone = tone, Octave = octave, Duration = duration, TimeOfPlaySinceStartup = Time.realtimeSinceStartup }; RecordToneInfo(info); AudioController.Play(toneClipName); }