加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

sublime + cocos lua

发布时间:2020-12-14 17:20:20 所属栏目:百科 来源:网络整理
导读: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.argv[1]tmp = tmpp

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读