1.创建lua编译系统cocosLua.sublime-build {"cmd": ["python", "D:/Lua_simulator/startLuaSimulator.py","$file"], "shell": true,} 2.创建 startLuaSimulator.py # -*- coding: utf-8 -*-# 使用utf8字符集import osimport systmppath =sys.arg
1.创建lua编译系统 cocosLua.sublime-build
{ "cmd": ["python", "D:/Lua_simulator/startLuaSimulator.py","$file"], "shell": true, }
2.创建 startLuaSimulator.py
# -*- coding: utf-8 -*- # 使用utf8字符集 import os import sys tmppath =sys.argv[1] tmp = tmppath.replace('\\','/') srclist=[] index=tmp.find('src') while index!=-1: srclist.append(tmp[:index]) index=tmp.find('src',index+1) rightPath="" for p in srclist: if os.path.exists(p+"src") and os.path.exists(p+"res"): rightPath = p break if rightPath=="": print "no suitable path" sys.exit(1) #没有合适的路径,找到合适的路径后,就执行代码 os.system('D:/Lua_simulator/luaTest.exe -workdir '+rightPath)3.编译好的模拟器,融合一下就ok