Ejemplo n.º 1
0
    internal static void AddBundleToBuildList(string bundleName, ref Dictionary <string, List <string> > buildingRoutes)
    {
        BundleData bundle = BundleManager.GetBundleData(bundleName);
        var        state  = BundleManager.GetBuildStateOfBundle(bundleName);

        if (bundle == null)
        {
            Debug.LogError("Cannot find bundle " + bundleName);
            return;
        }

        //if( BuildHelper.IsBundleNeedBunild(bundle) )
        if (state.changed)
        {
            string rootName = BundleManager.GetRootOf(bundle.name);
            if (buildingRoutes.ContainsKey(rootName))
            {
                if (!buildingRoutes[rootName].Contains(bundle.name))
                {
                    buildingRoutes[rootName].Add(bundle.name);
                }
                else
                {
                    Debug.LogError("Bundle name duplicated: " + bundle.name);
                }
            }
            else
            {
                List <string> buildingList = new List <string>();
                buildingList.Add(bundle.name);
                buildingRoutes.Add(rootName, buildingList);
            }
        }
    }