UnityEngine.Object _obj = AssetDatabase.LoadAssetAtPath(_materialPath + @"\" + _materialFiles[j].Name, typeof(UnityEngine.Object)) as UnityEngine.Object;
if (_obj == null)
{
DebugX.Log(_materialFiles[j].Name + " is null.");
continue;
}
Material _mat = (Material)_obj;
_mat.shader = Shader.Find("Toon/Diffuse");
Texture _textureMain = AssetDatabase.LoadAssetAtPath(_assetsPath + @"\" + _dirName + ".tga", typeof(Texture)) as Texture;
if (null != _textureMain)
{
_mat.mainTexture = _textureMain;
}
else
{
DebugX.LogError(_dirName + " Texture is null.");
}