コード例 #1
0
    public SceneMusicElement GetSceneMusicElement(string name)
    {
        SceneMusicElement element = null;

        _mSceneMusicElement.TryGetValue(name, out element);

        return(element);
    }
コード例 #2
0
    private bool LoadSceneMusicElement(SecurityElement element, out SceneMusicElement obj)
    {
        obj = new SceneMusicElement();

        string attribute = element.Attribute("Name");

        if (attribute != null)
        {
            obj.sceneName = attribute;
        }

        if (element.Children != null)
        {
            foreach (SecurityElement childrenElement in element.Children)
            {
                if (childrenElement.Tag == "Music")
                {
                    MusicElement obj1 = null;
                    if (!LoadMusicElement(childrenElement, out obj1))
                    {
                        continue;
                    }

                    obj.usableMusicList.Add(obj1);
                }
                else if (childrenElement.Tag == "SoundEffect")
                {
                    MusicElement obj1 = null;
                    if (!LoadMusicElement(childrenElement, out obj1))
                    {
                        continue;
                    }

                    obj.usableSoundEffectList.Add(obj1);
                }
            }
        }

        return(true);
    }
コード例 #3
0
    public override bool Load(SecurityElement element)
    {
        if (element.Tag != "Sounds")
        {
            return(false);
        }

        if (element.Children != null)
        {
            foreach (SecurityElement childrenElement in element.Children)
            {
                if (childrenElement.Tag == "LoadingMusic")
                {
                    SceneMusicElement obj = null;
                    if (!LoadSceneMusicElement(childrenElement, out obj))
                    {
                        continue;
                    }

                    _mSceneMusicElement.Add(obj.sceneName, obj);
                }
                else if (childrenElement.Tag == "SceneMusic")
                {
                    SceneMusicElement obj = null;
                    if (!LoadSceneMusicElement(childrenElement, out obj))
                    {
                        continue;
                    }

                    _mSceneMusicElement.Add(obj.sceneName, obj);
                }
            }

            return(true);
        }
        return(false);
    }