Example #1
0
 static LuaKitMenu()
 {
     if (!beCheck && !CheckHaveLuaDefineSymbol() && ScriptBaseSetting.SourceSaveCheck)
     {
         if (ScriptBaseSetting.ToLuaSourceSaveCheck)
         {
             if (EditorUtility.DisplayDialog("提示", "检测您正在使用HotScriptKit中ToLua模块,需添加模块宏以确保模块可正常使用", "添加", "取消"))
             {
                 beCheck = true;
                 PlayerSettingExtensions.SetDefineSymbols(ScriptBaseSetting.ToLuaDefineSymbol);
                 AssetDatabase.Refresh();
             }
             beCheck = false;
         }
         else if (ScriptBaseSetting.XLuaSourceSaveCheck)
         {
             if (EditorUtility.DisplayDialog("提示", "检测您正在使用HotScriptKit中XLua模块,需添加模块宏以确保模块可正常使用", "添加", "取消"))
             {
                 beCheck = true;
                 PlayerSettingExtensions.SetDefineSymbols(ScriptBaseSetting.XLuaDefineSymbol);
                 AssetDatabase.Refresh();
             }
             beCheck = false;
         }
     }
 }
        public static void AddSymbols()
        {
            if (ScriptBaseSetting.ToLuaSourceSaveCheck)
            {
                PlayerSettingExtensions.SetDefineSymbols(ScriptBaseSetting.ToLuaDefineSymbol);
            }
            else if (ScriptBaseSetting.XLuaSourceSaveCheck)
            {
                PlayerSettingExtensions.SetDefineSymbols(ScriptBaseSetting.XLuaDefineSymbol);
            }

            AssetDatabase.Refresh();
        }