Exemple #1
0
    private static void BuildAll()
    {
        InitState();

        LoadShaderList();

        List <string> buildList = GetObjectPathByConfig();

        List <BundleData> bundles = new List <BundleData>();

        for (int i = 0; i < buildList.Count; i++)
        {
            bundles.Add(AddRootBundleData(buildList[i]));
        }


        for (int i = 0; i < bundles.Count; i++)
        {
            if (BuildHelp.BuildRootBundle(bundles[i]))
            {
                DependsData.Add(CreateDependsData(bundles[i]));
            }
        }
        //BuildPipeline.BuildAssetBundles()
        //
        if (DependsData.Count > 0)
        {
            string dependsConfigPath = BuildHelp.GenerateOutputDependsPath();
            BMDataAccessor.SaveBundleBuildeStates();
            BMDataAccessor.SaveObjectToJsonFile <List <BundleDependsData> >(DependsData, dependsConfigPath);
            BMDataAccessor.SaveReleaseDependsData(DependsData, BundleSetting.PlatformOutputPath + "/DependsData.release");
            BMDataAccessor.ClearBundleBuildStates(DependsData);
            DependsData.Clear();
        }
        else
        {
            Debug.Log("There is no written DependsData.txt!");
        }
    }