[Unity][ECS]学习笔记(一)

20220621

搞了3天,终于跑起来了一个System。

学习视频:

https://www.youtube.com/watch?v=ILfUuBLfzGI&list=PLzDRvYVwl53s40yP5RQXitbT--IRcHqba&index=1&t=122shttps://www.youtube.com/watch?v=ILfUuBLfzGI&list=PLzDRvYVwl53s40yP5RQXitbT--IRcHqba&index=1&t=122s【游戏开发】Unity ECS DOTS 教程 (合集)机翻!_哔哩哔哩_bilibilihttps://www.youtube.com/watch?v=ILfUuBLfzGI&list=PLzDRvYVwl53s40yP5RQXitbT--IRcHqba&index=1自带谷歌机翻后续会补充自动生成的英文字幕项目源代码下载地址:https://unitycodemonkey.com/video.php?v=ILfUuBLfzGIhttps://www.bilibili.com/video/av93838467/?vd_source=b2a6377adfb8c1346aecd5a89bc3b7e2官方手册

Entities overview | Entities | 0.50.1-preview.2https://docs.unity3d.com/Packages/com.unity.entities@0.50/manual/index.htmlUnity版本:2020.3.30

Entity版本:0.51.0-privew.32

遇到的问题:

  1. 引入Entity包之后编译报错,缺少API啥的,一般是因为Unity版本不匹配,根据官方手册调整为对应版本就可以了,并不是版本越高越好,😂
  2. 添加了System之后,没有看到打印的log,原因是我一开始按照官方文档装了全套的包,没有按照学习视频里的提示,装了Netcode,导致在DefaultWorld中没有System生成,继承ComponentSystem会自动在Client和Server两个world里自动生成,但是因为对应world里没有符合条件的entity,Entities.ForEach 就会导致 Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak 警告,并且后续会不停的刷 Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 5) ,如果按学习视频里的方法添加System,注意不要把包 Netcode 导入工程。

论坛上的参考:

Manually created System does not update - Unity Forumhttps://forum.unity.com/threads/manually-created-system-does-not-update.882085/

 总结:

Unity版本最好使用2020.3.30,因为目前官方的例子都是这个版本,官方例子git如下

GitHub - Unity-Technologies/EntityComponentSystemSamplesContribute to Unity-Technologies/EntityComponentSystemSamples development by creating an account on GitHub.https://github.com/Unity-Technologies/EntityComponentSystemSamples初学者只引入需要的package,Netcode这种在没掌握基础前不要引入。

中国官方例子工程:

unity-tech-cn/DOTSSample: 该项目的目的是同时测试和演示来自 Unity DOTS 技术堆栈的多个新包。 - DOTSSample - Plastic Hub DOTSSample - 该项目的目的是同时测试和演示来自 Unity DOTS 技术堆栈的多个新包。https://plastichub.unity.cn/unity-tech-cn/DOTSSample

例子工程:https://gitee.com/grimraider/unity-ecsdotshttps://gitee.com/grimraider/unity-ecsdots

 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

GrimRaider

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值