摘要: 1 public class QuadTree_1 2 { 3 //节点内允许的最大对象 4 private int maxObjs = 1; 5 6 //最大层级 7 private int maxLvl = 3; 8 9 //当前层级 10 private int lvl; 11 12 //当前 阅读全文
posted @ 2024-11-25 15:11 zjp971014 阅读(40) 评论(0) 推荐(0)
摘要: /// <summary> /// 图集形式为.png形式 并在unity中有很多sprite的子图 /// </summary> private void AtlasSplit() { string guidStr = Selection.assetGUIDs[0]; string path = 阅读全文
posted @ 2023-07-31 10:26 zjp971014 阅读(274) 评论(0) 推荐(0)
摘要: #region 二分查找法 public static int BinarySertch(int[] arr, int startIndex, int endIndex, int result) { if (startIndex > endIndex) { return -1; } int midI 阅读全文
posted @ 2023-04-08 14:54 zjp971014 阅读(15) 评论(0) 推荐(0)
摘要: 我是用unity的版本是2020 创建一个安卓工程并删除他的MainActivity类 这里我将res下面的所有文件加都删除掉了 因为打aar会将这也资源都打进去 我们用不到所以就都删除了 将app的gradle的dependencies中的引用文件都删除这些也是我们不需要的 在com.exampl 阅读全文
posted @ 2022-07-01 12:05 zjp971014 阅读(366) 评论(0) 推荐(0)
摘要: alphaHitTestMinimumThreshold 会根据alpha值进行判断点击使用方法 transform.GetComponent<Image>().alphaHitTestMinimumThreshold = 0.5f; 注意: 该精灵图片必须开启读写权限 该精灵图不能打入图集中 阅读全文
posted @ 2022-04-29 20:00 zjp971014 阅读(508) 评论(0) 推荐(0)
摘要: //IComparable的排序使用 public class Student : IComparable { private string name; private int age; public string Name { get { return name; } } public int A 阅读全文
posted @ 2022-03-04 20:51 zjp971014 阅读(49) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-01-17 17:07 zjp971014 阅读(122) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-12-03 20:19 zjp971014 阅读(266) 评论(0) 推荐(0)
摘要: 直接看代码 public class MeshTool { [MenuItem("Tools/Mesh/Combine")] public static void MeshCombine() { GameObject obj = (GameObject)Selection.activeObject; 阅读全文
posted @ 2021-12-02 14:27 zjp971014 阅读(99) 评论(0) 推荐(0)
摘要: 1.静态合批 场景中static物体不能移动,旋转或缩放 物体必须静态!!! 2.动态合批 比如说你的shader使用Vertex Position, Normal和single UV三种属性你的物体最多不能超过300顶点(900 / 3) 3.Enable GPU Instancing 创建一个材 阅读全文
posted @ 2021-12-01 16:05 zjp971014 阅读(36) 评论(0) 推荐(0)