Example #1
0
        private void CreateSelectedAsset(GridViewData data, string selectedAssetPath, List <int> selectedIDs)
        {
            AssetDependencyData adData = data.GetData <AssetDependencyData>();

            if (adData.assetPath == selectedAssetPath)
            {
                selectedIDs.Add(data.ID);
                return;
            }
            if (adData.allDepends != null && Array.IndexOf(adData.allDepends, selectedAssetPath) >= 0)
            {
                if (!data.IsExpand)
                {
                    foreach (var childAssetPath in adData.directlyDepends)
                    {
                        if (IsAssetIgnored(childAssetPath))
                        {
                            continue;
                        }
                        AssetDependencyData childADData = AssetDependencyUtil.GetDependencyData(childAssetPath);
                        GridViewData        viewData    = new GridViewData(childAssetPath, childADData);
                        AddChildData(data, viewData);
                    }
                    data.IsExpand = true;
                }

                foreach (var childData in data.Children)
                {
                    CreateSelectedAsset(childData, selectedAssetPath, selectedIDs);
                }
            }
        }
Example #2
0
        protected override void OnDataExpand(GridViewData data)
        {
            if (data.IsExpand)
            {
                return;
            }
            AssetDependencyData adData = data.GetData <AssetDependencyData>();

            if (adData.directlyDepends != null && adData.directlyDepends.Length > 0)
            {
                for (int i = 0; i < adData.directlyDepends.Length; ++i)
                {
                    string assetPath = adData.directlyDepends[i];

                    if (IsAssetIgnored(assetPath))
                    {
                        continue;
                    }

                    AssetDependencyData childADData = AssetDependencyUtil.GetDependencyData(assetPath);
                    var childData = new GridViewData(assetPath, childADData);
                    AddChildData(data, childData);
                }
            }
        }
Example #3
0
        public int[] ShowDependency(string[] assetPaths)
        {
            Clear();

            List <int> ids = new List <int>();

            foreach (var assetPath in assetPaths)
            {
                if (IsAssetIgnored(assetPath))
                {
                    continue;
                }

                AssetDependencyData adData   = AssetDependencyUtil.GetDependencyData(assetPath);
                GridViewData        viewData = new GridViewData(assetPath, adData);
                AddChildData(RootData, viewData);

                ids.Add(viewData.ID);
            }
            return(ids.ToArray());
        }