--启动调试 if UnityEngine.Application.isEditor then pcall(function() package.cpath = UnityEngine.Application.dataPath .. '/../emmyLua.dll/?.dll' local dbg = require('emmy_core') dbg.tcpConnect('localhost', 9966) end) end function StartLevel() print("关卡开始啦") end function StopLevel() print("关卡结束啦") end
第一关脚本
最新推荐文章于 2024-08-18 11:20:40 发布
该代码段展示了在Unity游戏中如何启动EmmyLua调试器,通过TCP连接到localhost的9966端口。当Application.isEditor为真时,它会加载emmyLua库并建立连接。此外,还定义了StartLevel和StopLevel函数来标记关卡的开始和结束。
摘要由CSDN通过智能技术生成