上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 47 下一页
摘要: # 默认的展示方式 # 自定义后的展示方式 # 标签类,enum成员加上这个标签才会按自定义的方式显示 public class CustomEnumAttribute : HeaderAttribute { public CustomEnumAttribute(string header) : b 阅读全文
posted @ 2022-04-01 23:44 yanghui01 阅读(174) 评论(0) 推荐(0)
摘要: 【接口参照了c# HashSet】 UnionWith: 合集IntersectWith: 交集ExceptWith: 差集SymmetricExceptWith: 相当于异或, 相同的排除, 不同的留下 IsSubsetOf: 是否为子集IsSupersetOf: 是否为超集IsProperSup 阅读全文
posted @ 2022-04-01 00:09 yanghui01 阅读(54) 评论(0) 推荐(0)
摘要: # HashSet使用散列表实现,其内部实现和Dictionary类似,可以看作是一个只有key没有value的Dictionary 【散列映射】 # 就是通过hashCode获得散列桶(buckets)的索引 # 使用了除留余数法(实现起来简单),以及散列桶数组的长度使用了素数的大小(素数使得索引 阅读全文
posted @ 2022-03-31 00:23 yanghui01 阅读(112) 评论(0) 推荐(0)
摘要: 本质还是一颗二叉搜索树,只是在其基础上增加了AddFix和RemoveFix来做平衡性修正,确保不会出现极端不平衡的情况。 【规则】 a) 根节点为黑 b) 红色节点的子节点只能是2个黑 c) 黑色节点的子节点只能是:1个红,2个红,2个黑或没有子节点,不可能出现1个黑(如下图所示) d) 任一结点 阅读全文
posted @ 2022-03-28 23:21 yanghui01 阅读(87) 评论(0) 推荐(0)
摘要: BSTree的全称: Binary Search Tree 【规则】 # 左子节点的值总是小于父节点 # 右子节点的值总是大于父节点 【添加,查找】 # 添加和查找相对简单,按着规则来就可以,比当前值小左边(蓝色),大在右边(黄色) 【删除】 # 首先是要找到要删除的节点,然后再按下面的情况来删除 阅读全文
posted @ 2022-03-26 16:25 yanghui01 阅读(53) 评论(0) 推荐(0)
摘要: # 最简单的就是,直接将anchor先设为center-mid,然后再设置位置大小 public static void SetAnchoredPos(RectTransform rtf, float x, float y) { var v2Mid = Vector2.one * 0.5f; rtf 阅读全文
posted @ 2022-03-25 22:14 yanghui01 阅读(82) 评论(0) 推荐(0)
摘要: #if UNITY_EDITOR using UnityEditor; public class MyToggleMenu { const string PrefsKey_IsAutoReloadXxx = "MyToggleMenu.IsAutoReloadXxx"; static int _is 阅读全文
posted @ 2022-03-25 21:49 yanghui01 阅读(53) 评论(0) 推荐(0)
摘要: 【math.random】 math.random() --返回一个[0, 1)之间的浮点数math.random(100) --返回一个[1, 100]间的整数math.random(1, 100) --返回一个[1, 100]间的整数math.random(20, 30) --返回一个[20, 阅读全文
posted @ 2022-03-25 21:37 yanghui01 阅读(221) 评论(0) 推荐(0)
摘要: # 展示最近打开的预制体历史 # 通过左右箭头就能快速打开最近打开过的预制体 public class AssetNavigateEditor : EditorWindow { [MenuItem("Window/MyTools/Prefab Open History", false, 1)] st 阅读全文
posted @ 2022-03-24 23:15 yanghui01 阅读(142) 评论(0) 推荐(0)
摘要: # 需要服务器返回当前页和总页数 local Pager = {} Pager.__index = Pager function Pager.new() local obj = {} setmetatable(obj, Pager) obj:ctor() return obj end functio 阅读全文
posted @ 2022-03-23 23:56 yanghui01 阅读(45) 评论(0) 推荐(0)
上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 47 下一页