摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MaxHeap { public class M 阅读全文
posted @ 2022-01-12 15:31 围墙外的世界 阅读(31) 评论(0) 推荐(0) 编辑
摘要: using System.Collections; using System.Collections.Generic; using UnityEditor; using UnityEngine; public class CombineSkinnedMeshMananger { private co 阅读全文
posted @ 2021-12-06 16:38 围墙外的世界 阅读(469) 评论(0) 推荐(0) 编辑
摘要: using System.Collections; using System.Collections.Generic; using UnityEngine; public enum GridType { None =0, Road, Obstacle, } public class Grid { p 阅读全文
posted @ 2021-11-19 14:54 围墙外的世界 阅读(982) 评论(0) 推荐(0) 编辑
摘要: 1.loadfile——只编译,不运行 loadfile故名思议,它只会加载文件,编译代码,不会运行文件里的代码。 2.dofile——执行 每次调用都会执行里面的代码 3.require——我只执行一次 require和dofile有点像,不过又很不一样,require在第一次加载文件的时候,会执 阅读全文
posted @ 2021-02-22 11:04 围墙外的世界 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 一 .:self lua编程中,经常遇到函数的定义和调用,有时候用点号调用,有时候用冒号调用。 Account={num=0}; function Account.Minus(self,num) self.num=self.num-num; end function Account:AddNum(n 阅读全文
posted @ 2021-02-19 15:31 围墙外的世界 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 1. 函数是第一类值 可以如下表示: a={p=print}; a.p(1); 在lua中所有的,所有的函数都是匿名的。当讨论函数名时,比如print,实际上指的是保存该函数的变量。 2.局部函数 在定义局部递归函数时,由于原来的方法不适用,所以一点是极易出错的 local fact =functi 阅读全文
posted @ 2021-02-18 10:26 围墙外的世界 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 在lua5.2及之前的版本中,所有的数值都以双精度浮点格式表示。从5.3版本开始,Lua为数值提供了俩种选择:integer的64位整型和被称为float的双精度浮点型。 >type(3) -->number >type(3.0) -->number 整型值和浮点型值的类型都是"number",所以 阅读全文
posted @ 2021-02-10 21:48 围墙外的世界 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Lua支持逻辑运算符: and or 和not。将boolean的类型false和nil当作假,而把其他值当作真(短路运算) >4 and 5 -->5 >nil an 13 -->13 >false and 22 -->false >0 or 5 >5 在Lua语言中,形如x=x or v的习惯写 阅读全文
posted @ 2021-02-10 21:32 围墙外的世界 阅读(750) 评论(0) 推荐(0) 编辑
摘要: 在lua语言中,全局变量无需声明即可使用,未经初始化的全局变量也不会发生错误,只是默认值为nil >b --nil 阅读全文
posted @ 2021-02-10 21:19 围墙外的世界 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 父类中所有的非静态成员属性都会被子类继承下去,父类中的私有成员属性,是被编译器隐藏了,因此访问不到,但是确实被继承了下去。 #include <iostream> using namespace std; class Father { public: int A; private: int B; } 阅读全文
posted @ 2021-02-07 15:11 围墙外的世界 阅读(84) 评论(0) 推荐(0) 编辑