Пример #1
0
        public void Process(Component @object)
        {
            var label = (UILabel)@object;

            // 图片字体! 打包字
            if (label.bitmapFont != null)
            {
                string uiFontPath = KDepBuild_NGUI.BuildUIFont(label.bitmapFont);
                //CResourceDependencies.Create(label, CResourceDependencyType.BITMAP_FONT, uiFontPath);
                KAssetDep.Create <KBitmapFontDep>(label, uiFontPath);

                label.bitmapFont = null;
            }
            else if (label.trueTypeFont != null)
            {
                string fontPath = KDependencyBuild.BuildFont(label.trueTypeFont);

                //CResourceDependencies.Create(label, CResourceDependencyType.FONT, fontPath);
                KAssetDep.Create <KUILabelDep>(label, fontPath);
                label.trueTypeFont = null; // 挖空依赖的数据
            }
            else
            {
                Logger.LogWarning("找不到Label的字体: {0}, 场景: {1}", label.name, EditorApplication.currentScene);
            }
        }
Пример #2
0
        public void Process(Component @object)
        {
            var sprite = (UISprite)@object;

            if (sprite.atlas != null)
            {
                string atlasPath = KDepBuild_NGUI.BuildUIAtlas(sprite.atlas);
                //CResourceDependencies.Create(sprite, CResourceDependencyType.UI_SPRITE, atlasPath);
                KAssetDep.Create <KUISpriteDep>(sprite, atlasPath);
                sprite.atlas = null;
            }
            else
            {
                Logger.LogWarning("UISprite null Atlas: {0}, Scene: {1}", sprite.name, EditorApplication.currentScene);
            }
        }