Esempio n. 1
0
        void UpdateGameUniqueData(string gameSpecificPath)
        {
            var node = LevelEditorUtils.JSONNodeFromFileResourcesPath(gameSpecificPath);

            BoardWidth  = node.GetInt(FIELD_BOARD_WIDTH);
            BoardHeight = node.GetInt(FIELD_BOARD_HEIGHT);

            InvisibleBoardIndex = new List <int>();
            var invisible_board_index = node.GetCollection("invisible_board_index");

            foreach (var item in invisible_board_index)
            {
                InvisibleBoardIndex.Add(item.AsInt());
            }

            //关卡类型与数字段的对应关系
            LevelNumToLevelType = new SortedDictionary <int, string>();
            var dic = node.GetDictionary(FIELD_LEVELNUM_TO_TYPE);

            foreach (var item in dic)
            {
                LevelNumToLevelType.Add(item.Value.AsInt(), item.Key);
            }

            SortLevelBeforeThisNum = node.GetInt(FIELD_SORTLEVELNUM_BEFORE);

            LevelsPerFile = node.GetInt(FIELD_LEVELS_PER_FILE);

            LevelNumOrigin = node.GetInt(FIELD_LEVELS_NUM_ORIGIN);

            Layers = new List <string>();
        }
Esempio n. 2
0
        void UpdateLevelSettingsData(string path)
        {
            var node = LevelEditorUtils.JSONNodeFromFileResourcesPath(path);

            if (node != null)
            {
                levelSettingConfig = new LevelSettingConfig();
                levelSettingConfig.Update(node);
            }
        }
Esempio n. 3
0
        public static List <string> GetGameTypes()
        {
            List <string> gameTypes = new List <string>();
            var           node      = LevelEditorUtils.JSONNodeFromFileResourcesPath(FILE_META);
            var           games     = node.GetCollection(FIELD_GAMES);

            foreach (var item in games)
            {
                gameTypes.Add(item.AsString());
            }
            return(gameTypes);
        }
Esempio n. 4
0
        void UpdateGameItems(string itemsPath)
        {
            var node = LevelEditorUtils.JSONNodeFromFileResourcesPath(itemsPath);

            DicBoardItem = new Dictionary <string, BoardItem>();
            _itemSprites = new Dictionary <string, Sprite>();
            var collection = node.GetCollection("items");

            foreach (var data in collection)
            {
                BoardItem t = new BoardItem();
                t.Update(data);
                Sprite s = Resources.Load <Sprite>(WhichGame + "/Sprites/" + t.SpriteId);
                _itemSprites.Add(t.Name, s);
                DicBoardItem.Add(t.Name, t);
            }
        }
Esempio n. 5
0
        private void Start()
        {
            JSONNode node = LevelEditorUtils.JSONNodeFromFileResourcesPath(
                LevelEditorInfo.Instance.EditorConfigPath + LevelEditorInfo.FILE_BRUSH);

            UpdateData(node);



            foreach (var data in _list)
            {
                BrushCatView cat = Instantiate(prefabBrushCatView);
                cat.transform.SetParent(brushRoot);
                cat.transform.localScale = new Vector3(1, 1, 1);
                cat.SetData(data);
            }
        }