예제 #1
0
        private void RefreshData_Left_list()
        {
            if (mLeft_Select_Platform == null)
            {
                return;
            }
            var    platform_name             = XPlatformUtil.GetNameText(mLeft_Select_Platform.Value);
            string source_packages_root_path = VFSEditorUtil.GetSourcePackagesFolderPath(platform_name);
            string package_stream_root_path  = VFSUtil.GetPackagesRootFolderInStreamingAssets(platform_name);

            //检查,StreamingAssets
            if (mDict_MainPackage_SourcePackage[mLeft_Select_Platform.Value] && mDict_MainPackage_StreamingAssets[mLeft_Select_Platform.Value])
            {
                //两边都有,我们来看看两边的build_id是否一致
                string build_info_source_path = VFSUtil.GetMainPackage_BuildInfo_Path(source_packages_root_path);
                string build_info_stream_path = VFSUtil.GetMainPackage_BuildInfo_Path(package_stream_root_path);
                if (File.Exists(build_info_stream_path) && File.Exists(build_info_source_path))
                {
                    try
                    {
                        var build_info_source = JsonUtility.FromJson <TinaX.VFSKitInternal.BuildInfo>(File.ReadAllText(build_info_source_path));
                        var build_info_stream = JsonUtility.FromJson <TinaX.VFSKitInternal.BuildInfo>(File.ReadAllText(build_info_stream_path));

                        if (build_info_source.BuildID != build_info_stream.BuildID)
                        {
                            main_package_not_same = true;
                        }
                    }
                    catch { }
                }
            }
            else
            {
                main_package_not_same = false;
            }

            //扩展组的处理
            mDict_ExtensionGroups_Info.Clear();
            if (mDict_Extensions_SourcePackage[mLeft_Select_Platform.Value])
            {
                string   source_extensions_root_path = VFSUtil.GetExtensionPackageRootFolderInPackages(source_packages_root_path);
                string[] group_names = VFSUtil.GetValidExtensionGroupNames(source_extensions_root_path);
                foreach (var group in group_names)
                {
                    //streamingassets 中存在嘛
                    if (VFSUtil.IsValidExtensionPackage(VFSUtil.GetExtensionGroupFolder(package_stream_root_path, group)))
                    {
                        //存在,检查build_id
                        string build_id_path_source = VFSUtil.GetExtensionGroup_BuildInfo_Path(source_packages_root_path, group);
                        string build_id_path_stream = VFSUtil.GetExtensionGroup_BuildInfo_Path(package_stream_root_path, group);
                        try
                        {
                            var b_info_source = JsonUtility.FromJson <TinaX.VFSKitInternal.BuildInfo>(File.ReadAllText(build_id_path_source));
                            var b_info_stream = JsonUtility.FromJson <TinaX.VFSKitInternal.BuildInfo>(File.ReadAllText(build_id_path_stream));
                            if (b_info_source.BuildID == b_info_stream.BuildID)
                            {
                                mDict_ExtensionGroups_Info.Add(group, 2);
                            }
                            else
                            {
                                mDict_ExtensionGroups_Info.Add(group, 1);
                            }
                        }
                        catch { }
                        if (!mDict_ExtensionGroups_Info.ContainsKey(group))
                        {
                            mDict_ExtensionGroups_Info.Add(group, 2);
                        }
                    }
                    else
                    {
                        // 不存在
                        mDict_ExtensionGroups_Info.Add(group, 0);
                    }
                }
            }


            mFlag_RefreshData_left_platform = mLeft_Select_Platform;
            mFlag_RefreshData_left          = true;
        }