摘要: print("*********Lua调用C# 重载函数相关知识点***********") local obj = CS.Lesson6() --虽然Lua自己不支持写重载函数 --但是Lua支持调用C#中的重载函数 print(obj:Calc()) print(obj:Calc(15, 1)) 阅读全文
posted @ 2020-10-29 13:08 UnitySir 阅读(578) 评论(0) 推荐(0) 编辑
摘要: print("*********Lua调用C# ref方法相关知识点***********") Lesson5 = CS.Lesson5 local obj = Lesson5() --ref参数 会以多返回值的形式返回给lua --如果函数存在返回值 那么第一个值 就是该返回值 --之后的返回值 阅读全文
posted @ 2020-10-29 13:06 UnitySir 阅读(593) 评论(0) 推荐(0) 编辑
摘要: print("*********Lua调用C# 拓展方法相关知识点***********") Lesson4 = CS.Lesson4 --使用静态方法 --CS.命名空间.类名.静态方法名() Lesson4.Eat() --成员方法 实例化出来用 local obj = Lesson4() -- 阅读全文
posted @ 2020-10-29 13:05 UnitySir 阅读(217) 评论(0) 推荐(0) 编辑
摘要: print("*********Lua调用C# 数组相关知识点***********") local obj = CS.Lesson3() --Lua使用C#数组相关知识 --长度 userdata --C#怎么用 lua就怎么用 不能使用#去获取长度 print(obj.array.Length) 阅读全文
posted @ 2020-10-29 13:03 UnitySir 阅读(1256) 评论(0) 推荐(0) 编辑
摘要: print("*********Lua调用C#枚举相关知识点***********") --枚举调用 --调用Unity当中的枚举 --枚举的调用规则 和 类的调用规则是一样的 --CS.命名空间.枚举名.枚举成员 --也支持取别名 PrimitiveType = CS.UnityEngine.Pr 阅读全文
posted @ 2020-10-29 13:01 UnitySir 阅读(1126) 评论(0) 推荐(0) 编辑
摘要: print("*********Lua调用C#类相关知识点***********") --lua中使用C#的类非常简单 --固定套路 --CS.命名空间.类名 --Unity的类 比如 GameObject Transform等等 —— CS.UnityEngine.类名 --CS.UnityEng 阅读全文
posted @ 2020-10-29 13:00 UnitySir 阅读(458) 评论(0) 推荐(0) 编辑
摘要: using System.IO; using UnityEngine; using XLua; namespace DSFramework { /// <summary> /// Lua管理器 /// 保证解析器的唯一性 /// </summary> public class DSLuaMgr : 阅读全文
posted @ 2020-10-28 14:43 UnitySir 阅读(184) 评论(0) 推荐(0) 编辑
摘要: using System.Collections; using System.Collections.Generic; using UnityEngine; using XLua; public class Lesson9_CallLuaTable : MonoBehaviour { void St 阅读全文
posted @ 2020-10-28 14:41 UnitySir 阅读(859) 评论(0) 推荐(0) 编辑
摘要: using DSFramework; using UnityEngine; using UnityEngine.Events; using XLua; //接口不允许有成员变量 //可以使用属性来接收 [CSharpCallLua] public interface ILuaCallInterfac 阅读全文
posted @ 2020-10-28 14:39 UnitySir 阅读(257) 评论(0) 推荐(0) 编辑
摘要: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; using XLua; public class CallLuaClass { //在这个 阅读全文
posted @ 2020-10-28 14:37 UnitySir 阅读(214) 评论(0) 推荐(0) 编辑