//根据本地动画json导致,导入生成一个中间json数据
        public void Import()
        {
            //先读取本地数据
            _LoadAndCacheCinemaJsonData();
            // 生成中间json文件
            int count = npcIdMapCinemaIds.Count;

            if (count > 0)
            {
                BridgeHideNpcCinemaJsonData bridgeHideNpcCinemaJsonData = new BridgeHideNpcCinemaJsonData();
                List <BridgeHideNpcCinemaJsonData.JsonData> datas       = new List <BridgeHideNpcCinemaJsonData.JsonData>();
                foreach (int hideNpcId in npcIdMapCinemaIds.Keys)
                {
                    BridgeHideNpcCinemaJsonData.JsonData tempData = new BridgeHideNpcCinemaJsonData.JsonData();
                    tempData.npc_id = hideNpcId;
                    //data.cinema_type = CinemaType.None;
                    tempData.cinema_ids = npcIdMapCinemaIds[hideNpcId].ToArray();
                    datas.Add(tempData);
                }
                if (datas.Count > 0)
                {
                    bridgeHideNpcCinemaJsonData.data = datas.ToArray();
                    //导出成中间json,exe的当前目录
                    Persistence.json.Save(CinemaDataCommon.BridgeHideNpcCinemaJsonName, bridgeHideNpcCinemaJsonData);
                }
            }
        }
        //生成的中间json数据,导出新的动画json数据
        public void Export()
        {
            //1. 读取本地cinemjson数据
            _LoadAndCacheCinemaJsonData();
            //2. 读取中间json数据
            BridgeHideNpcCinemaJsonData bridgeHideNpcCinemaJsonData = Persistence.json.LoadFile <BridgeHideNpcCinemaJsonData>(CinemaDataCommon.BridgeHideNpcCinemaJsonName);
            //3. 修改本地cinemaJson数据并导出成新的json文件
            List <int> _dataChangedCinemaIds = new List <int>();//动画配置数据发生变化了的动画ID

            if (null != bridgeHideNpcCinemaJsonData && (bridgeHideNpcCinemaJsonData.data.Length > 0))
            {
                int count = bridgeHideNpcCinemaJsonData.data.Length;
                for (int i = 0; i < count; i++)
                {
                    BridgeHideNpcCinemaJsonData.JsonData jsonData = bridgeHideNpcCinemaJsonData.data[i];
                    int        npcId                = jsonData.npc_id;
                    CinemaType cinemType            = jsonData.cinema_type;
                    int[]      cinemaIdsTobeChanged = jsonData.cinema_ids;//收集需要修改的动画ID
                    //3 优先处理指定类型的动画,不然处理修改指定的动画ID
                    if (cinemType != CinemaType.None)
                    {
                        List <int> cinemaIdsWithSameType;
                        if (cinemaTypeMapCinemaIds.TryGetValue(cinemType, out cinemaIdsWithSameType))
                        {
                            cinemaIdsTobeChanged = cinemaIdsWithSameType.ToArray();
                        }
                    }


                    foreach (var cinemaIdToBeChanged in cinemaIdsTobeChanged)
                    {
                        //根据动画ID获取对应的cinemaJsonData
                        CinemaJsonData cjd;
                        if (cinemaIdMapCinemaJsonData.TryGetValue(cinemaIdToBeChanged, out cjd))
                        {
                            if (cjd is CameraCinemaJsonData)
                            {
                                CameraCinemaJsonData ccjd = cjd as CameraCinemaJsonData;
                                //目前只有镜头动画才有隐藏npc的功能
                                //尝试追加npcId
                                bool dataChanged = _TryAddHideNpcId(ref ccjd, npcId);
                                if (dataChanged)
                                {
                                    //记录已经修改的动画ID
                                    if (!_dataChangedCinemaIds.Contains(cinemaIdToBeChanged))
                                    {
                                        _dataChangedCinemaIds.Add(cinemaIdToBeChanged);
                                    }
                                }
                            }
                        }
                    }
                }
            }

            //4. 将数据有变化的动画数据导出为json
            foreach (var dataChangedCinemaId in _dataChangedCinemaIds)
            {
                //找到动画名
                string cinemaName = "";
                if (cinemaIdMapCinemaName.TryGetValue(dataChangedCinemaId, out cinemaName))
                {
                    //获取更新后的cinemaJsonData
                    CinemaJsonData cjd;
                    if (cinemaIdMapCinemaJsonData.TryGetValue(dataChangedCinemaId, out cjd))
                    {
                        //导出json文件,目前只修改镜头动画的数据
                        if (null != cjd && cjd is CameraCinemaJsonData)
                        {
                            Persistence.json.Save(CinemaDataCommon.GetCinemaJsonFileFullPath(cinemaName), cjd);
                            Console.WriteLine("modify cinema id:{0},cinema name:{1}", dataChangedCinemaId, cinemaName);
                        }
                    }
                }
            }
        }