예제 #1
0
        public AssetBuild GroupAsset(string path, GroupBy groupBy = GroupBy.Filename, string group = null)
        {
            var value = assets.Find(assetBuild => assetBuild.name.Equals(path));

            if (value == null)
            {
                value      = new AssetBuild();
                value.name = path;
                assets.Add(value);
            }
            if (groupBy == GroupBy.Explicit)
            {
                value.group = group;
            }
            if (IsScene(path))
            {
                currentScene = Path.GetFileNameWithoutExtension(path);
            }
            value.groupBy = groupBy;
            if (autoRecord && Assets.development)
            {
                PatchAsset(path);
            }
            return(value);
        }
        private string GetBundle(AssetBuild assetBuild)
        {
            if (assetBuild.path.EndsWith(".shader"))
            {
                return(RuledAssetBundleName("shaders"));
            }
            switch (assetBuild.groupBy)
            {
            case GroupBy.Explicit: return(RuledAssetBundleName(assetBuild.group));

            case GroupBy.Filename: return(RuledAssetBundleName(Path.Combine(Path.GetDirectoryName(assetBuild.path), Path.GetFileNameWithoutExtension(assetBuild.path))));

            case GroupBy.Directory: return(RuledAssetBundleName(Path.GetDirectoryName(assetBuild.path)));

            default: return(string.Empty);
            }
        }
예제 #3
0
 private string GetGroupName(AssetBuild assetBuild)
 {
     return(GetGroupName(assetBuild.groupBy, assetBuild.name, assetBuild.group));
 }