Unity5 使用自带的字体导致BuildAssetbundle失败An asset is marked with HideFlags.DontSave but is included in the
来源:互联网 发布:淘宝退货率排行 编辑:程序博客网 时间:2024/05/22 00:18
今天打Bundle的时候Unity提示错误
An asset is marked with HideFlags.DontSave but is included in the build:Asset: 'Library/unity editor resources'Included from scene: 'Assets/wyft.unity'(You are probably referencing internal Unity data in your build.)UnityEditor.BuildPipeline:BuildAssetBundles(String, BuildAssetBundleOptions, BuildTarget)BuildAssetbundle:Build() (at Assets/script/Editor/AssetBundle/BuildAssetBundle.cs:11)
Building - Failed to write file: archive:/CAB-5ec89fa231356c313c9a8d0837b61320/CAB-5ec89fa231356c313c9a8d0837b61320UnityEditor.BuildPipeline:BuildAssetBundles(String, BuildAssetBundleOptions, BuildTarget)BuildAssetbundle:Build() (at Assets/script/Editor/AssetBundle/BuildAssetBundle.cs:11)
转自http://blog.csdn.net/huutu http://www.thisisgame.com.cn
到Unity论坛 搜索,得到答案是 UILabel 引用了Unity自带的字体
于是乎 拉上小伙伴一起把所有的Prefab过一遍,找了一会儿我就烦了……太慢了 这边急着打包
决定还是写段代码来干活
前提:
Prefab是文本格式保存。
Prefab里面记录着各种文件、代码引用以及其它的一些设置、类的值等等。
在Unity中,每个文件都有一个UID 存储在meta文件中,在Prefab中就只能看到一长串的UID,如果是引用了Unity自带的资源,那么UID是0!
根据这个特性,来遍历读取所有的Prefab,寻找其中UID为0的Prefab然后修改。
图中 fileID:0 就是代表这个UILabel 引用了Unity的字体
转自http://blog.csdn.net/huutu http://www.thisisgame.com.cn
有时候尽管在编辑器中修改了字体,但是Prefab中仍然残留这 TrueTypeFont对Unity内置字体的引用,这个就手动删除把。
附上代码:
/************************************************ * 文件名:CheckUnityFont.cs * 描述:CheckUnityFont 检测是NGUI的UILabel中引用了Unity自带字体 * 创建人:陈鹏 * 创建日期:201601015 * ************************************************/using UnityEngine;using System.Collections;using System.Collections.Generic;using UnityEditor;using System.IO;public class CheckUnityFont : MonoBehaviour{ // 在菜单来创建 选项 , 点击该选项执行搜索代码 [MenuItem("Tools/Check Unity Font")] static void Check() { string[] tmpFilePathArray = Directory.GetFiles(Application.dataPath, "*.*", SearchOption.AllDirectories); EditorUtility.DisplayProgressBar("CheckUnityFont", "CheckUnityFont", 0f); for (int i=0;i<tmpFilePathArray.Length;i++) { EditorUtility.DisplayProgressBar("CheckUnityFont", "CheckUnityFont",( i*1.0f)/tmpFilePathArray.Length); string tmpFilePath = tmpFilePathArray[i]; if(tmpFilePath.EndsWith(".prefab")) { StreamReader tmpStreamReader = new StreamReader(tmpFilePath); string tmpContent = tmpStreamReader.ReadToEnd(); if(tmpContent.Contains("mFont: {fileID: 0}")) { Debuger.LogError(tmpFilePath); } } if (tmpFilePath.EndsWith(".prefab")) { StreamReader tmpStreamReader = new StreamReader(tmpFilePath); string tmpContent = tmpStreamReader.ReadToEnd(); if (tmpContent.Contains("guid: 0000000000000000d000000000000000")) { Debuger.LogError(tmpFilePath); } } } EditorUtility.ClearProgressBar(); }}
0 0
- Unity5 使用自带的字体导致BuildAssetbundle失败An asset is marked with HideFlags.DontSave but is included in the
- Unity 解决 An asset is marked with HideFlags.DontSave but is included in the build 问题。
- An asset is marked with HideFlags.DontSave but is included in the build:
- An asset is marked with HideFlags.DontSave but is included in the build
- An asset is marked with HideFlags.DontSave but is included in the build 解决方法
- 打包的时候报错 An asset is marked with HideFlags.DontSave but is included in the build的解决办法
- unity 项目build 的时候后报错An asset is marked with HideFlags.DontSave but is included in the build:
- unity 项目build 的时候后报错An asset is marked with HideFlags.DontSave but is included in the build:
- Call can throw, but it is not marked with 'try' and the error is not handled
- swift编码出现Call can throw, but it is not marked with 'try' and the error is not handled错误的解决
- Swift:Call can throw, but it is not marked with 'try' and the error is not handled
- Swift Call can throw, but it is not marked with 'try' and the error is not handled
- Call can throw but it is not marked with try
- swift编码出现Call can throw, but it is not marked with***错误的解决
- Unity3D中HideFlags.DontSave使用解析
- 使用UIImagePickerController导致[Generic] Creating an image format with an unknown type is an error
- JAX-WS 2.2 API is required, but an older version was found in the JDK.
- The page is performing an async postback but the ScriptManager
- 【JavaWeb-24】AOP介绍和术语、手动/半自动/自动实现AOP、基于XML和注解的AspectJ使用、JdbcTemplate的使用
- java小程序 示例 菲薄垃圾数列
- 可“电”者几人
- 排序算法汇总
- 欢迎使用CSDN-markdown编辑器
- Unity5 使用自带的字体导致BuildAssetbundle失败An asset is marked with HideFlags.DontSave but is included in the
- 1004---找相同字符串个数操作
- 几种深度学习框架的分析与比较
- leetcode OJ:223. Rectangle Area
- Eclipse 下载安装使用
- MFC----------矩形的计算
- 一.Contiki之进程(1)——进程结构体定义
- UVa 156 Ananagrams
- python数据库模块MySQLdb