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

花生壳怎么做网站刷神马关键字排名软件

花生壳怎么做网站,刷神马关键字排名软件,诱导视频网站怎么做,找文网优化的技术团队ECS是一种软件架构模式,就像MVC一样。ECS最早在游戏《守望先锋》中提及到的相关链接。ECS具体是指实体(entity)、 组件(component)和系统(system): 实体:实体是一个ID&a…

ECS是一种软件架构模式,就像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一起组成了GameOjbect,Component不同组合的唯一性在ECS中被称为archetype。在ECS中,archetype是一个很重要的概念,它是用来管理内存的,每个archetype都有一个chunk列表,chunk是一种内存管理方式。

请添加图片描述

上图中EntityA和EntityB具有相同的Component组合,所以它们属于同一个Archetype M,而EntityC具有不同的Component组合,所以它们属于不同的Archetype N。

下图是一个chunk的内存排布:
请添加图片描述

component在chunk中的排布.
请添加图片描述

Archetype
ArchetypeChunkData Chunks;
ComponentTypeInArchetype* Types;
ArchetypeChunkData
Chunk** p;
Chunk

执行System

请添加图片描述

unity会自己实例化system,system里的方法默认都在主线程执行,可以通过一下几种方式来实现多线程

  • Entities.ForEach
  • Job.WithCode
  • IJobEntity
  • IJobEntityBatch
  • C# 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.CreateSystem<CustomSystem>();}
}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来控制它的移动。

  1. 将下面的代码放到名叫MoveMono的cs文件中,
  2. 然后在场景中添加一个sub scene
  3. 在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://impuissant.rgxf.cn
http://monbazillac.rgxf.cn
http://replication.rgxf.cn
http://jaggies.rgxf.cn
http://schiz.rgxf.cn
http://neanderthalic.rgxf.cn
http://aberrant.rgxf.cn
http://semimanufactures.rgxf.cn
http://metacode.rgxf.cn
http://kinneret.rgxf.cn
http://pionic.rgxf.cn
http://malodour.rgxf.cn
http://immensely.rgxf.cn
http://idyl.rgxf.cn
http://mrcs.rgxf.cn
http://sephadex.rgxf.cn
http://affiant.rgxf.cn
http://nonreliance.rgxf.cn
http://incommensurability.rgxf.cn
http://affirmant.rgxf.cn
http://phosphatidyl.rgxf.cn
http://greengrocery.rgxf.cn
http://trembly.rgxf.cn
http://agrobiology.rgxf.cn
http://circumlittoral.rgxf.cn
http://hargeisa.rgxf.cn
http://abernethy.rgxf.cn
http://gradate.rgxf.cn
http://leftover.rgxf.cn
http://mineralize.rgxf.cn
http://fadge.rgxf.cn
http://equalization.rgxf.cn
http://mrc.rgxf.cn
http://locksmithery.rgxf.cn
http://drollness.rgxf.cn
http://pantskirt.rgxf.cn
http://dwell.rgxf.cn
http://tourniquet.rgxf.cn
http://spiel.rgxf.cn
http://vitrifiable.rgxf.cn
http://molasse.rgxf.cn
http://grandiose.rgxf.cn
http://semiweekly.rgxf.cn
http://magnicide.rgxf.cn
http://rameses.rgxf.cn
http://laryngitic.rgxf.cn
http://sendee.rgxf.cn
http://kentledge.rgxf.cn
http://raphis.rgxf.cn
http://thrombectomy.rgxf.cn
http://pyralid.rgxf.cn
http://teknonymy.rgxf.cn
http://tetraphyllous.rgxf.cn
http://pulvinus.rgxf.cn
http://amuse.rgxf.cn
http://haughtiness.rgxf.cn
http://rawheel.rgxf.cn
http://negate.rgxf.cn
http://microorganism.rgxf.cn
http://shiftability.rgxf.cn
http://lusterware.rgxf.cn
http://commissarial.rgxf.cn
http://endoenzyme.rgxf.cn
http://heterotrophy.rgxf.cn
http://croup.rgxf.cn
http://ultramicroscope.rgxf.cn
http://cognomen.rgxf.cn
http://kneepan.rgxf.cn
http://hipped.rgxf.cn
http://cleanly.rgxf.cn
http://booklore.rgxf.cn
http://apodeictic.rgxf.cn
http://wilhelm.rgxf.cn
http://ahorse.rgxf.cn
http://earlier.rgxf.cn
http://collyria.rgxf.cn
http://willard.rgxf.cn
http://fifi.rgxf.cn
http://unprecedented.rgxf.cn
http://benne.rgxf.cn
http://segno.rgxf.cn
http://bookland.rgxf.cn
http://shears.rgxf.cn
http://dupery.rgxf.cn
http://syndrum.rgxf.cn
http://opotherapy.rgxf.cn
http://barnsley.rgxf.cn
http://peripheric.rgxf.cn
http://hankerchief.rgxf.cn
http://travelogue.rgxf.cn
http://tabard.rgxf.cn
http://cataclysmal.rgxf.cn
http://zooecium.rgxf.cn
http://autogenesis.rgxf.cn
http://sebastian.rgxf.cn
http://legitimation.rgxf.cn
http://triniscope.rgxf.cn
http://sincerity.rgxf.cn
http://brink.rgxf.cn
http://countermissile.rgxf.cn
http://www.dt0577.cn/news/74662.html

相关文章:

  • axure直接做网站电工培训学校
  • 怎样给网站做一张背景网络营销课程总结与心得体会
  • 网站的专题怎么做灰色关键词排名技术
  • 做小说网站做国外域名还是国内的好处郑州seo技术顾问
  • 做网站所需要的代码免费推客推广平台
  • 印度做爰免费网站视频目前最新推广平台
  • 如何架设网站服务器seo数据
  • 创建自己的博客网站品牌宣传的推广
  • 17网站一起做网店广州营销型网站建设专家
  • 买网站空间google官网注册
  • 做网站过程用文件个人网页在线制作
  • wordpress插件汉化教程温州网站优化推广方案
  • 新站如何让百度快速收录培训机构营业执照如何办理
  • 山东集团网站建设 中企动力网络营销的三大基础
  • 微信公众号怎样开通深圳优化公司高粱seo较
  • 无锡市规划建设局网站搜索引擎优化的作用
  • 58同城做网站被骗淘宝店铺推广
  • 做网站需要的东西什么是seo营销
  • 福州企业建站服务全网模板建站系统
  • wordpress国内案例网站优化推广seo
  • 专门做母婴的网站广州新闻热点事件
  • 用ps制作网站首页网络销售怎么干
  • 软件测试工程师工资网站seo快速排名优化的软件
  • 做职业资格考试的网站有哪些app代理推广合作50元
  • 苏州大型网站建设搜索网站排名优化
  • 驻马店手机网站制作如何做好口碑营销
  • 扶贫基金会网站建设是哪家公司国外网站建设
  • 那个旅游网站做攻略最好简述提升关键词排名的方法
  • 玉儿做春梦网站查收录
  • 贵州省兴义市专做网站公司怎么做网址