Unity Dots V0.51初尝试
安装
1.在 Package Manager 面板,点击左边 + 号,选择 git : 输入 com.unity.entities 就会自动安装
2.manifest.json 加入 "com.unity.rendering.hybrid": "0.51.0-preview.32"
项目设置
1.Color Space改为 Linear
2.URP的设置中需要勾选Advanced SRP Batcher
文档地址
https://docs.unity3d.com/Packages/com.unity.entities@0.51/api/index.html
https://docs.unity3d.com/Packages/com.unity.rendering.hybrid@0.51/manual/creating-a-new-hybrid-renderer-project.html
Build Config设置
建立共用的 config,另外还需 建立 Android、win、IOS的配置
RotationSpeed_ForEach.cs
必须是struct,不能是 class,继承IComponentData
1 | using Unity.Entities; |
RotationSpeedSystem_ForEach.cs
class必须加partial关键字,继承 SystemBase
1 | using Unity.Entities; |
新建 Cube
选中该Cube,左上角 Tag 标签下 勾选 ConvertToEntity ,挂载 RotationSpeedSystem_ForEach 脚本,速度填写 2 ,运行就能看到效果
示意图
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 个人软件开发记录!