Untiy 打包LightMap 报错:Inconsistent asset when sorting preload assets: '' fileID: 0

BigAzrael 2018-02-08 04:03:36
版本:Unity 2017.2.f1(64bit)

代码:

LightMaps lightMaps = ScriptableObject.CreateInstance<LightMaps>();
int count = LightmapSettings.lightmaps.Length;
lightMaps.lightmapColor = new Texture2D[count];
lightMaps.lightmapDir = new Texture2D[count];
lightMaps.shadowMask = new Texture2D[count];

for (int i = 0; i < count; i++) {
lightMaps.lightmapColor[i] = LightmapSettings.lightmaps[i].lightmapColor;
lightMaps.lightmapDir[i] = LightmapSettings.lightmaps[i].lightmapDir;
lightMaps.shadowMask[i] = LightmapSettings.lightmaps[i].shadowMask;
}

AssetDatabase.CreateAsset(lightMaps,"Assets/RealV/LightmapTexture/LightMaps.asset");
SetAssetBundlesName(path);
BuildPipeline.BuildAssetBundles(targetSourceDir, BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows);


报错:
Inconsistent asset when sorting preload assets: '' fileID: 0
UnityEditor.BuildPipeline:BuildAssetBundles(String, BuildAssetBundleOptions, BuildTarget)
com.RDTech.Tools.Unity.Editor.CreateObjectTree:rdBuild() (at Assets/Scripts/Editor/CreateObjectTree.cs:43)

求助!
...全文
946 回复 打赏 收藏 举报
写回复
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
相关推荐
发帖
Unity3D
加入

2116

社区成员

Unity3D相关内容讨论专区
社区管理员
  • Unity3D
  • 芝麻粒儿
  • Unity官方
申请成为版主
帖子事件
创建了帖子
2018-02-08 04:03
社区公告

Unity3D社区公告:

  1. 社区致力于解决各种Unity3D相关的“疑难杂症”。
  2. 社区不允许发布与Unity3D或相关技术无关内容。
  3. 社区版主邀请各位一道为打造优秀社区不懈努力。