public static void GenBindings() { //var d = typeof(UnityEngine.MonoBehaviour).GetConstructors(); //Debug.Log("d.length=" + d.Length); //return; if (EditorApplication.isCompiling) { EditorUtility.DisplayDialog("提示", "等待Unity编译完再点", "确定" ); return; } Type[] arrEnums, arrClasses; HashSet <string> bridgeTypes; if (!JSBindingSettings.CheckClasses(out arrEnums, out arrClasses, out bridgeTypes)) { return; } JSDataExchangeEditor.reset(); UnityEngineManual.initManual(); CSGenerator.GenBindings(arrEnums, arrClasses); JSGenerator.GenBindings(arrEnums, arrClasses); CSWrapGenerator.GenWraps(arrEnums, arrClasses, bridgeTypes); AssetDatabase.Refresh(); }
public static void GenBindings() { if (EditorApplication.isCompiling) { EditorUtility.DisplayDialog("Tip:", "please wait EditorApplication compiling", "OK"); return; } Type[] classes = JSBindingSettings.CheckClassBindings(); if (classes == null) { return; } // if (!EditorUtility.DisplayDialog("Tip", // "Files in these directories will all be deleted and re-created: \n" + // JSBindingSettings.csGenDir + "\n", // "OK", "Cancel") // ) // { // return; // } CSGenerator.Log = JSGenerator.Log = Debug.Log; CSGenerator.LogError = JSGenerator.LogError = Debug.LogError; JSGenerator.Application_dataPath = Application.dataPath; JSDataExchangeEditor.reset(); UnityEngineManual.InitManual(); CSGenerator.GenBindings(classes); JSGenerator.GenBindings(classes, JSBindingSettings.enums); UnityEngineManual.AfterUse(); AssetDatabase.Refresh(); }