Esempio n. 1
0
 public AssetBuilderV1(string zone, BuildTarget buildTarget, TexFormatGroup format, string oldVer, string newVer)
 {
     this.zone        = zone;
     this.buildTarget = buildTarget;
     this.texFormat   = format;
     this.oldVersion  = oldVer;
     this.newVersion  = newVer;
     Init();
 }
Esempio n. 2
0
        public AssetBuilderV1(string zone, BuildTarget buildTarget, TexFormatGroup format)
        {
            this.zone        = zone;
            this.buildTarget = buildTarget;
            this.texFormat   = format;
            int version = GetLatestVersion(zone, buildTarget, format);

            this.oldVersion = version.ToString("D3");
            this.newVersion = (version + 1).ToString("D3");
            Init();
        }
Esempio n. 3
0
        protected override void PreprocessComponent(Component comp)
        {
            UIAtlas atlas = comp as UIAtlas;

            if (atlas.spriteMaterial == null)
            {
                return;
            }
            if (atlas.spriteMaterial.shader.name == ShaderId.UI)
            {
                TexFormatGroup format = GetOption <TexFormatGroup>();
                if (format == TexFormatGroup.ETC || format == TexFormatGroup.PVRTC || format == TexFormatGroup.AUTO)
                {
                    UIAtlasMenu.SplitChannelETC(atlas);
                }
            }
        }
Esempio n. 4
0
        public static int GetLatestVersion(string zone, BuildTarget buildTarget, TexFormatGroup texGroup)
        {
            string rootDir = GetRootDir(zone, buildTarget, texGroup);

            if (!Directory.Exists(rootDir))
            {
                return(0);
            }
            int ver = 0;

            foreach (string d in Directory.GetDirectories(rootDir))
            {
                string lastDir = Path.GetFileName(d);

                int v = 0;
                if (int.TryParse(lastDir, out v))
                {
                    ver = Math.Max(ver, v);
                }
            }
            return(ver);
        }
Esempio n. 5
0
 public static string GetRootDir(string zone, BuildTarget buildTarget, TexFormatGroup texFormat)
 {
     return(Cdn.GetPath(OUTPUT_ROOT, zone, buildTarget.ToRuntimePlatform(), texFormat));
 }