Exemple #1
0
    /// <summary>
    /// 生成单个Tab页的GameData
    /// </summary>
    public static void GenerateGameData(string editorType)
    {
        //初始化缓存
        //ioBuffer4GameData = new IoBuffer();

        //获取某个tab的TreeContainer
        TreeContainer _treeContainer = GEditorRoot.GetIns().TreeContainerDic[editorType];
        //获取某个tab的KvContainer
        KVContainer _kvContainer = GEditorRoot.GetIns().KVContainerDic [editorType];

        //得到一个treeContainer下所有的treeItem信息
        TreeItemData[] itemData = _treeContainer.GetAllTreeItemData();

        //确保所有的treeItem数据都被(从sql)拉取到本地
        for (int i = 0; i < itemData.Length; i++)
        {
            string _treeItemID = itemData[i].TreeItemID;
            _kvContainer.CheckAndLoadTreeItemData2Local(_treeItemID);
        }

        //开始过滤并,返回过滤后要存储的二进制数据
        byte[] bs = GEditorConfig.FilterData(editorType, _kvContainer.KVDateDic);

        if (null == bs)
        {
            Debug.Log("未导出 editorType:" + editorType + " 原因数据为null");
            return;
        }
        //Debug.Log("TExportData------->bs.len:"+bs.Length);
        //ioBuffer4GameData.PutString(editorType);//存储tab名
        //ioBuffer4GameData.PutInt(_treeContainer.RootFolder.SubAllItemNums);//存储当前tab下数据总条数

        //递归存储一个treeItem下的所有gdata
        //SaveOneTreeItemData(_treeContainer.RootFolder,editorType);

        //NINFO 对存储到ioBuffer4GameData中的数据进行冗余过滤

        FileHelper.Save(GEditorEnum.EDITOR_GAME_DATA_ROOTURL, editorType + GEditorEnum.EDITOR_GAME_DATA_NAME, bs /*ioBuffer4GameData.ToArray()*/);

        //ioBuffer4GameData.Clear();

        //ioBuffer4GameData = null;
    }
Exemple #2
0
 public void SetKVMgr(KVContainer mgr)
 {
     _MyKVContainer = mgr;
 }