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

g2g有哪些网站seo入门基础知识

g2g有哪些网站,seo入门基础知识,科学城做网站公司,片多多影视剧免费SystemBase:支持主线程或多线程执行筛选实体任务。 主要介绍是内部成员:Entities的各种筛选方法,其内部成员还有EntityManager ForEach方法筛选,传递一个有参委托函数进去,参数ref xxx组件类(可填多个&…

SystemBase:支持主线程或多线程执行筛选实体任务。
主要介绍是内部成员:Entities的各种筛选方法,其内部成员还有EntityManager

ForEach方法筛选,传递一个有参委托函数进去,参数ref xxx组件类(可填多个)代表筛选条件。

WithAll:&& 形式筛选组件
WithAny: || 形式筛选组件
WithNone: 筛选出不带某组件的
WithChangeFilter:监听组件数据变化时触发筛选
WithSharedComponentFilter:筛选共享组件(指定特定数据)
WithStoreEntityQueryInField(ref EntityQuery对象):存储筛选结果
WithEntityQueryOptions(EntityQueryOptions):
        EntityQueryOptions.FilterWriteGroup:筛选带[WriteGroup(typeof(xxx))特性的组件
        EntityQueryOptions.IncludeDisabled:具有Disabled(已禁用)组件的实体
        EntityQueryOptions.IncludePrefab:具有Prefab组件的实体
WithoutBurst:不使用Burst编译
WithBurst:使用Burst编译

Run:主线程(单线程执行)
Schedule:多线程并发
ScheduleParallel:多线程并行

using System.Collections;
using System.Collections.Generic;
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Transforms;
using UnityEngine;
/// <summary>
/// 可操作主线程或多线程; ComponentSystem单线程 JobComponentSystem多线程
/// </summary>
public class MySystemBase : SystemBase
{EntityQuery query;//以下方法从上到下按顺序执行protected override void OnCreate(){Debug.Log("OnCreate");}protected override void OnStartRunning(){Debug.Log("OnStartRunning");}protected override void OnUpdate(){Debug.Log("OnUpdate");//使用内部成员Entities遍历所有实体筛选出Translation组件的实体进行修改Entities.ForEach((ref Translation trans) =>{trans.Value = new Unity.Mathematics.float3(0, 5, 0);}).Run();//使用WithAll增加筛选条件,必须带有PrintTestComponentData组件的//使用Run()代表是主线程执行Entities.ForEach((ref Translation trans) =>{trans.Value = new Unity.Mathematics.float3(0, 5, 0);}).WithAll<PrintTestComponentData>().Run();//WithAny 只要带任意一个即可满足筛选Entities.ForEach((ref Translation trans) =>{trans.Value = new Unity.Mathematics.float3(0, 5, 0);}).WithAny<PrintTestComponentData>().Run();//WithNone 不包含xxx的Entities.ForEach((ref Translation trans) =>{trans.Value = new Unity.Mathematics.float3(0, 5, 0);}).WithNone<PrintTestComponentData>().Run();//WithChangeFilter 监听组件值变化时才触发方法体,参数必须带上ref PrintTestComponentData  否则会报错Entities.ForEach((ref Translation trans, ref PrintTestComponentData data) =>{trans.Value = new Unity.Mathematics.float3(0, 5, 0);}).WithChangeFilter<PrintTestComponentData>().Run();//WithSharedComponentFilter 筛选共享组件 特定值为2的Entities.ForEach((ref Translation trans) =>{trans.Value = new Unity.Mathematics.float3(0, 5, 0);}).WithSharedComponentFilter(new MyShareComponentData() { data = 2 }).Run();//存储筛选结果        Entities.ForEach((ref Translation trans) =>{trans.Value = new Unity.Mathematics.float3(0, 5, 0);}).WithStoreEntityQueryInField(ref query).Run();NativeArray<Entity> array = query.ToEntityArray(Unity.Collections.Allocator.TempJob);foreach (var v in array){//do something}//过滤出带[WriteGroup]特性的组件实体  [WriteGroup(typeof(PrintTestComponentData))] 查询会根据查询中指定的组件的WriteGroupAttribute属性筛选所选实体Entities.ForEach((ref Translation trans) =>{trans.Value = new Unity.Mathematics.float3(0, 5, 0);}).WithEntityQueryOptions(EntityQueryOptions.FilterWriteGroup).Run();//过滤出带[DisableAutoCreation]特性的组件实体  该查询不会隐式的排除具有Disabled(已禁用)组件的实体Entities.ForEach((ref Translation trans) =>{trans.Value = new Unity.Mathematics.float3(0, 5, 0);}).WithEntityQueryOptions(EntityQueryOptions.IncludeDisabled).Run();//过滤出预制体实体  [DisableAutoCreation]  该查询不会隐式的排除具有Prefab组件的实体Entities.ForEach((ref Translation trans) =>{trans.Value = new Unity.Mathematics.float3(0, 5, 0);}).WithEntityQueryOptions(EntityQueryOptions.IncludePrefab).Run();//Schedule 多线程并发执行 ; WithoutBurst 不使用Burst编译Entities.ForEach((ref Translation trans) =>{trans.Value = new Unity.Mathematics.float3(0, 5, 0);}).WithoutBurst().Schedule();//ScheduleParallel 配合Job 多线程并行执行 WithBurst 使用Burst编译Entities.ForEach((ref Translation trans) =>{trans.Value = new Unity.Mathematics.float3(0, 5, 0);}).WithBurst().ScheduleParallel();query.Dispose();array.Dispose();}protected override void OnStopRunning(){Debug.Log("OnStopRunning");}protected override void OnDestroy(){Debug.Log("OnDestroy");}
}

http://www.zhongyajixie.com/news/14231.html

相关文章:

  • 通化好的网站建设的公司源码网
  • 成全视频免费观看在线看nba手机优化大师哪个好
  • 网站建设后续需要维护优化网站排名需要多少钱
  • 网站备案时间查询网络推广公司哪家好
  • 宝山区网站建设企业文化墙
  • 网站设计与网页制作代码大全网站快速优化排名方法
  • 用手机做网站的软件关键词在线试听免费
  • wordpress默认主题修改长春百度推广排名优化
  • 用html做网站的背景图怎么弄如何自己做一个网站
  • 网站建设 中山百度推广有效果吗
  • 论坛网站建设教程中国互联网协会官网
  • 网站建设优化需要懂那些知识如何推广网站方法
  • 斐讯n1 WordPress宁波网站推广优化
  • 江门专业网站制作费用镇江网站建设制作公司
  • 中瑞网络网站建设流程seo优化
  • 给别人做网站要问什么问题泰安百度公司代理商
  • cms支持是什么优化设计六年级下册数学答案
  • 刘强东自己做网站手机百度下载免费
  • 外贸网站建设哪家合适北京网讯百度科技有限公司
  • 北京网站建设企业百度人工客服在哪里找
  • 获取网站漏洞后下一步怎么做个人如何加入百度推广
  • 二手车网站制作申请一个网站需要多少钱
  • 兰州网站建设100网络营销好找工作吗
  • 网站开发所需要的技术公司以优化为理由裁员合法吗
  • magento 网站链接友情外链代发免费
  • 做公司网站页面哪家公司做推广优化好
  • 网站开发和网页上传的说法西安网红
  • 日本做头像的网站有哪些百度明星人气榜入口
  • 防止服务器上的网站被进攻家庭优化大师
  • 用php做的企业网站作业最新国内新闻事件今天