打包的时候提示
This MeshCollider requires the mesh to be marked as readable in order to be usable with the given transform.
解决方法:
模型的Read/Write Enabled打勾。
可以写个脚本批量设置一下
using UnityEngine;
using UnityEditor;
using System.IO;public class FixModel
{[MenuItem("Tools/FixModel")]static void Run(){var fs = Directory.GetFiles(Application.dataPath, "*.FBX", SearchOption.AllDirectories);foreach(var f in fs){var path = f.Replace(Application.dataPath, "Assets");var imp = AssetImporter.GetAtPath(path) as ModelImporter;if(null == imp){Debug.LogError(Path.GetFileName(f) + " is not a Model");}else{if(!imp.isReadable){imp.isReadable = true;Debug.Log("fix " + path);imp.SaveAndReimport();}}}AssetDataBase.Refresh();Debug.Log("Done");}
}