# moba-ulua-1803 **Repository Path**: xupig/moba-ulua-1803 ## Basic Information - **Project Name**: moba-ulua-1803 - **Description**: moba-demo - **Primary Language**: C# - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2023-01-14 - **Last Updated**: 2023-01-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # TeachTolua ####ULUA备忘 #### "."和":"区别? 1.Unity中的类和对象。 |类|对象| |:-|:-| Transform|transform, GameObject|gameObject Sprite|sprite Image|image Text|text --- |组合|调用| |:-|:-| |对象+方法|":"| |类+方法|"."| |对象/类+属性|"."| --- 2.Lua 中的表和对象 |表|对象| |:-|:-| |player={};|player=class('player');| --- |组合|调用| |:-|:-| |表this+方法|"."| |对象self+方法|":"| |表/对象+属性|"."| --- ####LuaScriptException 中应为翻译: |英文|中文| |:-|:-| |global|全局的| |field|字段| |property|属性| |arguments|参数| |arithmetic|算数| *LuaScriptException: [string "chunk"]:2: attempt to index global 'XXXX' (a nil value) 解决方法: 1.XXXX拼错了 2.XXXX有命名空间,没有加或者没有在define里面起别名 * LuaScriptException: [string "chunk"]:18: field or property xxxxx does not exist 解决方法: 1.xxx拼错了,大小写 2.AAAA.xxx ;AAAA这个类,没有wrap。 * LuaException: no overload for method takes '3' arguments 解决方法: 方法的参数个数是不对的 * LuaException: bad argument #1 解决方法: 第几个参数是坏的,有问题的,类型不对,空指针 * LuaException: [string "Controller/PlayerManager"]:92: attempt to perform arithmetic on global 'hp' (a nil value) 解决方法: hp为nil,但是使用hp进行了数学运算 LuaException: [string "View/BattlePanel"]:20: attempt to index upvalue 'JoyStick' (a boolean value) stack traceback: 解决方案: class的类对没有return 模块 LuaException: [string "Controller/JoyStick"]:44: attempt to index global 'self' (a nil value) 解决方案: self关键字只能在方法中使用 如果方法是:声明,你使用。来调用 LuaException: [string "event"]:156: [string "Item/HExplode"]:18: attempt to perform arithmetic on field 'skillRange' (a nil value) 解决方案: 对一个nil的变量进行了数学运算,skillRange为nil LuaException: [string "event"]:156: The object of type 'Transform' has been destroyed 。but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. LuaException: [string "events"]:16: handler parameter in addlistener function has to be function, nil not right Event.Addlistener 的参数需要时function,不能是nil