예제 #1
0
        public override XmlPlaySoundBrick Convert1(PlaySoundBrick m, XmlModelConvertBackContext c)
        {
            //var soundConverter = new SoundConverter();

            //return new XmlPlaySoundBrick
            //{
            //    Sound = soundConverter.Convert(m.Value, c)
            //};

            XmlSound sound = null;

            if (m.Value != null)
            {
                c.Sounds.TryGetValue(m.Value, out sound);
            }
            return(new XmlPlaySoundBrick
            {
                Sound = sound
            });
        }
        private static string GetSoundReferenceString(XmlSound sound)
        {
            var sprite = XmlParserTempProjectHelper.Sprite;

            var count = 0;

            foreach (var tempSound in sprite.Sounds.Sounds)
            {
                count++;
                if ((tempSound == sound) && (count == 1))
                {
                    return("../../../../../soundList/sound");
                }
                else if (tempSound == sound)
                {
                    return("../../../../../soundList/sound[" + count + "]");
                }
            }

            return("");
        }