1.在lua中调用unity日志打印hello world:
CS.UnityEngine.Debug.Log("hello world")
2.通过lua中创建一个unity中的GameObject
local newGameObj = CS.UnityEngine.GameObject("CreatByLua")
newGameObj.transform.position=CS.UnityEngine.Vector3(1,2,3)
注意:不需要使用new,按照上面方式,可以调用Unity中的方法,在场景中创建一个名为CreatByLua的游戏物体,并对其位置赋值。