当前位置: 首页 > news >正文

浦东建设网站柳州网站建设柳州

浦东建设网站,柳州网站建设柳州,修改新wordpress密码,强大的建筑人才网unity出了自己的对象池 这里记录一下用法 命名空间就是这个 一般有两种用法,第一种是在using里面获取,脱离这个域就释放。第二种是在Get和Release配合使用 // This version will only be returned to the pool if we call Release on it.//只有使用Re…

unity出了自己的对象池 这里记录一下用法

  • 命名空间就是这个
    在这里插入图片描述

  • 一般有两种用法,第一种是在using里面获取,脱离这个域就释放。第二种是在Get和Release配合使用

 // This version will only be returned to the pool if we call Release on it.//只有使用Release才会释放var simplifiedPoints = ListPool<Vector2>.Get();
//这种只要脱离了Scope就会自动释放// Copy the points into a temp list so we can pass them into the Simplify method// When the pooled object leaves the scope it will be Disposed and returned to the pool automatically.// This version is ideal for working with temporary lists.using (var pooledObject = ListPool<Vector2>.Get(out List<Vector2> tempList)){for (int i = 0; i < points.Length; ++i){tempList.Add(points[i]);}LineUtility.Simplify(tempList, 1.5f, simplifiedPoints);}return simplifiedPoints;
  • 一般比较常用的就几个集合类和下面这个,可以对自己的类进行一个池子回收。
using UnityEngine.Pool;public class GenericPoolExample
{class MyClass{public int someValue;public string someString;}void GetPooled(){// Get an instancevar instance = GenericPool<MyClass>.Get();// Return the instanceGenericPool<MyClass>.Release(instance);}
}
  • 对于一些unity中的GameObject对象可以使用ObjectPool
http://www.dtcms.com/a/598384.html

相关文章:

  • Linux 基础开发工具----Vim编辑器的常见命令
  • Flutter for HarmonyOS开发指南(八):国际化与本地化深度实践
  • 建设局主要负责什么黑帽seo软件
  • 购买东西网站怎么做网页空间租用
  • 什么网站做外贸最多的网站建设虚线的代码
  • AIDD - 自主决策实验室 Intrepid Labs 介绍
  • 自己网站建设要维护23个营销专业术语
  • 如何做app网站网站后端用什么语言
  • HarmonyOS SDK使能美团高效开发,打造优质创新应用体验
  • 河北公司网站建设效果网站整合discuz论坛
  • 沈阳网站建设哪里的公司比较好厦门市建设工程造价网
  • 插值——拉格朗日插值
  • 马鞍山集团网站设计国外免费ip地址和密码
  • ps做汽车网站下载长沙圭塘网站建设公司
  • AJAX和Promise
  • 直播网站建设费用腾讯云域名控制台
  • 山东兴润建设集团网站ps设计网站步骤
  • 广州网站 制作信科便宜seo就业
  • 基于ENAS与YOLOv8的草莓成熟度自动检测系统:原理、实现与性能优化(含详细代码)
  • 内网横向靶场——记录一次横向渗透(三)
  • 兰州电商平台网站建设设备外观设计效果图
  • 【XR开发系列】Unity下载与安装详细教程(UnityHub、Unity)
  • 深度学习——参数优化
  • 网站排名优化外包公司有限公司怎么纳税
  • Simulink 基础模块使用
  • 叫人做网站多少钱怎么根据视频链接找到网址
  • [论文阅读] 生成式人工智能嵌入对公众职业安全感冲击的影响机理及防范对策
  • 双桥区网站制作页面升访请广大狼
  • 余弦退火策略
  • Linux 网络:邻居子系统