I tried making a menu item to import a model as follow. But it does not import at all. Please help .
using UnityEngine;
using UnityEditor;
using System.Collections;
public class MyMenuItems : ScriptableObject {
[MenuItem("Assets/Import Model")]
static void ImportModel()
{
DoWork();
}
static void DoWork()
{
// import maya model
string path = @"c:\temp\house.mb";
ModelImporter modelImporter = AssetImporter.GetAtPath(path) as ModelImporter;
AssetDatabase.ImportAsset(path, ImportAssetOptions.Default);
}
}