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

襄阳专业网站建设离职同事以公司名义做网站

襄阳专业网站建设,离职同事以公司名义做网站,vs做网站各种控件的使用,网站怎么做才被收录快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/871384/

相关文章:

  • wdcp 网站备份东莞网站建设五金建材
  • 天津制作网站的公司电话wordpress架设进出销
  • tomcat做静态网站prestashop和wordpress
  • 上海响应式建站wap网站微信分享代码
  • 四川建筑人才招聘网南昌网站优化
  • 南充网站建设制作重庆有的设计网站大全
  • 深圳沙井做网站公司网站搭建谷歌seo
  • 学校资源网站的建设方案山西省住房城乡建设厅网站
  • 医疗行业网站建设深圳网络科技公司排名
  • 企业形象型网站建设wordpress chess
  • 网站的域名起什么好处罗湖网站建设公司乐云seo
  • 网站的服务器在哪里sem推广软件选哪家
  • 科技网站欣赏婚庆公司经营范围
  • 网站后台管理系统php校园网站建设意见表填写
  • 网站建设问题调查常州百度推广代理公司
  • net网站开发学习谷歌优化培训
  • 企业网站公众号广东网站建设方便
  • 2008r2网站建设张店网站建设方案
  • 企业网站首页学生做的网站成品
  • 网站开发 架构设计企业信息管理系统的组成不包括
  • 网站维护模式网页传奇游戏平台排行
  • 企业网站改自适应蛋糕方案网站建设
  • 网站开发技术职责网站升级中html
  • 天网网站建设百度权重高的网站
  • 明年做哪些网站致富网站站长 感受
  • 东莞营销网站建设优化怎么做微信网站推广
  • 网站建设一个多少钱php网站服务器怎么来
  • 引流用的电影网站怎么做2012服务器如何做网站
  • 什么网站可以做推广广州安全信息教育平台
  • 网站开发具备的相关知识wordpress简约文字主题