Advertisement

Unity ECS+Jobs系统案例解析(十一)

阅读量:

本部分将对ECS案例进行详细说明,相关资源可由读者自行获取,具体来源如下:
https://github.com/Unity-Technologies/EntityComponentSystemSamples

3、IJobForEach——Job System入门案例

该案例的构建方式与案例1存在高度相似性(若尚未查阅案例1的相关内容,建议先行了解案例1的详细信息),在ECS框架中,Entity与Component的设计理念基本一致,主要差异体现在System部分。在先前的示例中,我们采用的是ComponentSystem,虽然该方法具备可行性,但并不建议使用,因其运行于主线程中,未能充分发挥Job System的优势。因此,在当前案例中引入了Job System以提升性能。

复制代码
    using Unity.Burst;
    using Unity.Collections;
    using Unity.Entities;
    using Unity.Jobs;
    using Unity.Mathematics;
    using Unity.Transforms;
    using UnityEngine;
    
    public class RotationSpeedSystem_IJobForEach : JobCom

全部评论 (0)

还没有任何评论哟~