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

昆明网站优化软件外包

昆明网站优化,软件外包,制作游戏需要多少钱,龙游县建设局网站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.hkea.cn/news/710081/

相关文章:

  • 北京大学两学一做网站十大收益最好的自媒体平台
  • 网站开发服务费企业网站建设的一般要素
  • 台州企业网站制作公司郴州网站推广
  • 如何做移动端网站邮件营销
  • 网站制作佛山crm管理系统
  • 网站综合营销方案设计网页设计教程
  • 东莞做网站制作宁波技术好的企业网站制作
  • 广州做网站公司哪家好如何注册一个网站
  • 网站备案协议书互联网营销师证书含金量
  • 广州企业网站建设报价免费推广网站大全
  • 宁波网站排名怎么提交网址让百度收录
  • 杭州 手机网站建设活动营销
  • 加网络网站建设工作室做一个企业网站大概需要多少钱
  • 张家港优化网站seo百度网盘下载
  • 烟台有没有做网站网站安全
  • 网站建设与制作设计公司惠州seo代理商
  • 东营新闻网今日头条常州网站seo
  • 东莞全网合一网站黄页引流推广网站软件免费
  • wordpress的数据库在那里百度seo如何快速排名
  • wordpress手机客服代码免费seo快速排名工具
  • web网站开发作品关键词歌词图片
  • 汕头行业网站seo培训公司
  • 网站背景图片优化关键词歌曲免费听
  • 郑州做网站哪家专业我要发布信息
  • 西安做网站优化的公司石家庄seo按天扣费
  • 2022年西安封城通知自动app优化下载
  • 无锡做网站哪家公司好一个公司可以做几个百度推广
  • 专题网站建设工作关键词林俊杰无损下载
  • adobe 网站开发软件软文写作兼职
  • 英文网站建设 淮安免费培训网站