Beispiel #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>();
        }
Beispiel #2
0
        void UpdateLevelSettingsData(string path)
        {
            var node = LevelEditorUtils.JSONNodeFromFileResourcesPath(path);

            if (node != null)
            {
                levelSettingConfig = new LevelSettingConfig();
                levelSettingConfig.Update(node);
            }
        }
Beispiel #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);
        }
Beispiel #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);
            }
        }
        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);
            }
        }