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

网站制作大概多少钱91永久免费海外地域网名

网站制作大概多少钱,91永久免费海外地域网名,佛山市方维网络技术有限公司,个人网站 如何做推广ECS是一种软件架构模式#xff0c;就像MVC一样。ECS最早在游戏《守望先锋》中提及到的相关链接。ECS具体是指实体#xff08;entity#xff09;、 组件#xff08;component#xff09;和系统#xff08;system#xff09;#xff1a; 实体#xff1a;实体是一个ID就像MVC一样。ECS最早在游戏《守望先锋》中提及到的相关链接。ECS具体是指实体entity、 组件component和系统system 实体实体是一个ID它是一个唯一的标识符用于标识一个对象它本身不包含任何数据只是一个ID它的作用是用于标识一个对象它的数据是由组件来提供的。 组件组件是一个数据结构它包含了一些数据用于描述一个对象的属性组件是没有任何行为的它只是一个数据结构。 系统主要用户逻辑处理进行状态迁移。系统中不保留数据且是无状态的。 三者之间的关系如下图所示 ECS在unity中出现的原因 在使用unity开发的时候monobehaviour是我们最常用的然而monobehaviour中的update是基于gameobject去更新的且无序的这样很容易造成memory cache miss。而ECS是基于数据的它将具有相同Component组合的Entity放在一起这样可以更好的利用cache提高性能。 archetype 通过上面的图和介绍我们知道通过将不同的Component组合和Entity一起组成了GameOjbectComponent不同组合的唯一性在ECS中被称为archetype。在ECS中archetype是一个很重要的概念它是用来管理内存的每个archetype都有一个chunk列表chunk是一种内存管理方式。 上图中EntityA和EntityB具有相同的Component组合所以它们属于同一个Archetype M而EntityC具有不同的Component组合所以它们属于不同的Archetype N。 下图是一个chunk的内存排布 component在chunk中的排布. #mermaid-svg-dOLGdj5zBc8nNxlZ {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-dOLGdj5zBc8nNxlZ .error-icon{fill:#552222;}#mermaid-svg-dOLGdj5zBc8nNxlZ .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-dOLGdj5zBc8nNxlZ .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-dOLGdj5zBc8nNxlZ .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-dOLGdj5zBc8nNxlZ .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-dOLGdj5zBc8nNxlZ .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-dOLGdj5zBc8nNxlZ .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-dOLGdj5zBc8nNxlZ .marker{fill:#333333;stroke:#333333;}#mermaid-svg-dOLGdj5zBc8nNxlZ .marker.cross{stroke:#333333;}#mermaid-svg-dOLGdj5zBc8nNxlZ svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-dOLGdj5zBc8nNxlZ g.classGroup text{fill:#9370DB;fill:#131300;stroke:none;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:10px;}#mermaid-svg-dOLGdj5zBc8nNxlZ g.classGroup text .title{font-weight:bolder;}#mermaid-svg-dOLGdj5zBc8nNxlZ .nodeLabel,#mermaid-svg-dOLGdj5zBc8nNxlZ .edgeLabel{color:#131300;}#mermaid-svg-dOLGdj5zBc8nNxlZ .edgeLabel .label rect{fill:#ECECFF;}#mermaid-svg-dOLGdj5zBc8nNxlZ .label text{fill:#131300;}#mermaid-svg-dOLGdj5zBc8nNxlZ .edgeLabel .label span{background:#ECECFF;}#mermaid-svg-dOLGdj5zBc8nNxlZ .classTitle{font-weight:bolder;}#mermaid-svg-dOLGdj5zBc8nNxlZ .node rect,#mermaid-svg-dOLGdj5zBc8nNxlZ .node circle,#mermaid-svg-dOLGdj5zBc8nNxlZ .node ellipse,#mermaid-svg-dOLGdj5zBc8nNxlZ .node polygon,#mermaid-svg-dOLGdj5zBc8nNxlZ .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-dOLGdj5zBc8nNxlZ .divider{stroke:#9370DB;stroke:1;}#mermaid-svg-dOLGdj5zBc8nNxlZ g.clickable{cursor:pointer;}#mermaid-svg-dOLGdj5zBc8nNxlZ g.classGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-dOLGdj5zBc8nNxlZ g.classGroup line{stroke:#9370DB;stroke-width:1;}#mermaid-svg-dOLGdj5zBc8nNxlZ .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-dOLGdj5zBc8nNxlZ .classLabel .label{fill:#9370DB;font-size:10px;}#mermaid-svg-dOLGdj5zBc8nNxlZ .relation{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-dOLGdj5zBc8nNxlZ .dashed-line{stroke-dasharray:3;}#mermaid-svg-dOLGdj5zBc8nNxlZ #compositionStart,#mermaid-svg-dOLGdj5zBc8nNxlZ .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-dOLGdj5zBc8nNxlZ #compositionEnd,#mermaid-svg-dOLGdj5zBc8nNxlZ .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-dOLGdj5zBc8nNxlZ #dependencyStart,#mermaid-svg-dOLGdj5zBc8nNxlZ .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-dOLGdj5zBc8nNxlZ #dependencyStart,#mermaid-svg-dOLGdj5zBc8nNxlZ .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-dOLGdj5zBc8nNxlZ #extensionStart,#mermaid-svg-dOLGdj5zBc8nNxlZ .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-dOLGdj5zBc8nNxlZ #extensionEnd,#mermaid-svg-dOLGdj5zBc8nNxlZ .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-dOLGdj5zBc8nNxlZ #aggregationStart,#mermaid-svg-dOLGdj5zBc8nNxlZ .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-dOLGdj5zBc8nNxlZ #aggregationEnd,#mermaid-svg-dOLGdj5zBc8nNxlZ .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-dOLGdj5zBc8nNxlZ .edgeTerminals{font-size:11px;}#mermaid-svg-dOLGdj5zBc8nNxlZ :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} Archetype ArchetypeChunkData Chunks; ComponentTypeInArchetype* Types; ArchetypeChunkData Chunk** p; Chunk 执行System unity会自己实例化system,system里的方法默认都在主线程执行可以通过一下几种方式来实现多线程 Entities.ForEachJob.WithCodeIJobEntityIJobEntityBatchC# Job System 各部分的创建 下面是一个简单的例子创建一个CustomSystem它会在每一帧中更新CustomData的值。ComponentData不一定要和MonoBehaviour一起使用它可以单独使用像一些CPU密集性的计算可以使用ComponentData来实现。下面的示例重点是为了说明各部分的创建过程从LaunchECS中可以发现仅仅使用了World中的EntityManager来创建了一个Entity系统的创建被注视掉了。这是因为unity会自己实例化system所以我们不需要手动创建system。 public class Custom : MonoBehaviour {private void Awake(){LaunchECS();}private void LaunchECS(){var world World.DefaultGameObjectInjectionWorld;world.EntityManager.CreateEntity(typeof(CustomData));// world.CreateSystemCustomSystem();} }public struct CustomData : IComponentData {public int Value; }public partial class CustomSystem : SystemBase {[BurstCompile]protected override void OnUpdate(){var timeElapsedTime World.Time.ElapsedTime;Entities.ForEach((ref CustomData customData) {customData.Value (int)(100 * math.sin(timeElapsedTime));}).ScheduleParallel();} }游戏制作 ECS的大致情况我们已经了解了那如何在项目中应用呢。下面是一个简单的例子我们创建一个Cube然后通过ECS来控制它的移动。 将下面的代码放到名叫MoveMono的cs文件中然后在场景中添加一个sub scene在sub scene中添加一个Cube然后添加一个MoveMono组件并设置Velocity的值。 运行后我们会发现Cube会按照我们设置的Velocity的值进行移动。 [GenerateAuthoringComponent] public struct MoveData : IComponentData {public float3 Velocity; }public partial class MoveSystem : SystemBase {[BurstCompile]protected override void OnUpdate(){var deltaTime World.Time.DeltaTime;Entities.ForEach((ref Translation translation, in MoveData moveData) {translation.Value moveData.Velocity * deltaTime;}).ScheduleParallel();} }上面代码中使用了GenerateAuthoringComponent这个属性将会自动生成一个名为MoveMono的MonoBehaviour所有虽然我们并没有显示的创建MoveMono但是我们可以给GameObject添加组件是可以看到MoveMono. 除了GenerateAuthoringComponent属性以外还有其他方式去将ComponentData和MonoBehaviour关联起来还可以有其他方式。我们将在后面的gameplay文章中介绍。
http://www.w-s-a.com/news/389565/

相关文章:

  • 天河网站建设信科网络外包公司和公司直招哪个好
  • 网站制作哈尔滨聊天系统源码
  • 网站建设朋友圈素材青白江建设网站
  • 红酒网站设计软件设计文档
  • 如何创建网站目录网站申请支付宝接口
  • 网站做区块链然后往里面投钱品牌设计公司收费标准
  • 2022互联网+创新创业项目呼和浩特企业网站排名优化
  • 电子商务类网站建设山西自助建站系统怎么用
  • odoo做网站网站设置专栏有什么好处
  • 局域网内个人网站建设查询企业的网站有哪些
  • 网站建设属于技术开发吗网页制作团队
  • 做家常菜的网站哪个好哪个网站做图片外链
  • 眼科医院网站设计怎么做6深圳宝安是什么风险等级
  • 网站制作容易吗logo免费生成网站
  • 建设厅官方网站下载专区网络托管公司
  • 祥云平台官方网站网线制作实验原理
  • 把网站做成app的软件下载国外做兼职的网站有哪些
  • 网站建设 海豚弯专业的网站开发服务商
  • 那个网站有免费模板中国家装公司十大排名
  • 中铁建设集团有限公司门户网站余杭区建设规划局网站
  • 天猫网站建设的目标是什么做网站常见问题模板
  • 做php网站需要什么软件天津建设网官方网站
  • 南漳网站开发上海网站推广方法
  • 深圳seo网站大连旅顺房价
  • dede网站 地图什么做有没有做黑市网站
  • 做网站参考文献域名如何做网站
  • 怎么选择网站开发英文网站建设用途
  • 怎样做电子商务网站织梦生成手机网站
  • 公司网站建设选什么服务器网站里怎样添加关键词
  • 深圳建设局网站深业中城绿化项目营销型网站开发流程包括