예제 #1
0
        //释放
        public void UnLoad()
        {
            MusicCustom.Clear();
            GroupModuls.Clear();
            GroupFloors.Clear();
            GroupColSounds.Clear();
            ResetPoints.Clear();
            Sectors.Clear();

            LevelAssetBundle.Unload(true);
            LevelAssetBundle = null;
            LoadStatus       = GameModStatus.NotInitialize;
        }
예제 #2
0
        private void ReadLevelDefGame(XmlNode nodeBaseInfo)
        {
            foreach (XmlNode node in nodeBaseInfo.ChildNodes)
            {
                switch (node.Name)
                {
                case "BasePrefab": BasePrefab = node.InnerText; break;

                case "Sky": Sky = node.InnerText; break;

                case "SkyCustom":
                {
                    foreach (XmlNode node2 in node.ChildNodes)
                    {
                        switch (node2.Name)
                        {
                        case "SkyL": skyCustom.SkyB = node2.InnerText; break;

                        case "SkyR": skyCustom.SkyR = node2.InnerText; break;

                        case "SkyU": skyCustom.SkyU = node2.InnerText; break;

                        case "SkyD": skyCustom.SkyD = node2.InnerText; break;

                        case "SkyF": skyCustom.SkyF = node2.InnerText; break;

                        case "SkyB": skyCustom.SkyB = node2.InnerText; break;
                        }
                    }
                    break;
                }

                case "SkyLayer":
                {
                    SkyLayerType skyLayerType;
                    if (Enum.TryParse(node.InnerText, out skyLayerType))
                    {
                        SkyLayer = skyLayerType;
                    }
                    break;
                }

                case "Light":
                {
                    foreach (XmlNode node2 in node.ChildNodes)
                    {
                        switch (node2.Name)
                        {
                        case "L":
                        {
                            light.LightLColor = node2.InnerText;
                            foreach (XmlAttribute attribute in node2.Attributes)
                            {
                                if (attribute.Name == "hideLight")
                                {
                                    light.LightLHide = bool.Parse(attribute.InnerText);
                                }
                                else if (attribute.Name == "intensity")
                                {
                                    light.LightLIntensity = float.Parse(attribute.InnerText);
                                }
                            }
                            break;
                        }

                        case "R":
                        {
                            light.LightRColor = node2.InnerText;
                            foreach (XmlAttribute attribute in node2.Attributes)
                            {
                                if (attribute.Name == "hideLight")
                                {
                                    light.LightRHide = bool.Parse(attribute.InnerText);
                                }
                                else if (attribute.Name == "intensity")
                                {
                                    light.LightRIntensity = float.Parse(attribute.InnerText);
                                }
                            }
                            break;
                        }

                        case "Shadow":
                        {
                            light.LightShadowColor = node2.InnerText;
                            foreach (XmlAttribute attribute in node2.Attributes)
                            {
                                if (attribute.Name == "hideLight")
                                {
                                    light.LightShadowHide = bool.Parse(attribute.InnerText);
                                }
                                else if (attribute.Name == "intensity")
                                {
                                    light.LightShadowIntensity = float.Parse(attribute.InnerText);
                                }
                            }
                            break;
                        }
                        }
                    }
                    break;
                }

                case "Energy":
                {
                    foreach (XmlNode node2 in node.ChildNodes)
                    {
                        switch (node2.Name)
                        {
                        case "StartLife": { int i; if (int.TryParse(node2.InnerText, out i))
                                            {
                                                StartLife = i;
                                            }
                                            break; }

                        case "StartScore": { int i; if (int.TryParse(node2.InnerText, out i))
                                             {
                                                 StartScore = i;
                                             }
                                             break; }

                        case "LevelScore": { int i; if (int.TryParse(node2.InnerText, out i))
                                             {
                                                 LevelScore = i;
                                             }
                                             break; }
                        }
                    }
                    break;
                }

                case "MusicCustom":
                {
                    MusicCustom.Clear();
                    foreach (XmlNode node2 in node.ChildNodes)
                    {
                        if (node2.Name == "Music")
                        {
                            MusicCustom.Add(node2.InnerText);
                        }
                    }
                    break;
                }

                case "MusicTheme": { GameBgmType i; if (Enum.TryParse(node.InnerText, out i))
                                     {
                                         MusicTheme = i;
                                     }
                                     break; }

                case "ErrorSolve": { LevelErrorSolveType i; if (Enum.TryParse(node.InnerText, out i))
                                     {
                                         ErrorSolve = i;
                                     }
                                     break; }
                }
            }
        }