当前位置:网站首页>Unity ECS dots notes
Unity ECS dots notes
2022-04-23 20:35:00 【One Mr rabbit one】
Entity
Component
System
Job
- C# Although support Thread, But in Unity Only data can be processed in , for example : Internet news 、 download . If you want to Thread Call in Unity Of API That's not going to work .
- job Using the main thread in API Will report a mistake :“UnityException: GetKeyInt can only be called from the main thread.”
protected override JobHandle OnUpdate(JobHandle inputDeps)
{
Entities.ForEach((ref Move_Component moveComponent, in Input_Component inputComponent) =>
{
moveComponent.direction = 0;
moveComponent.direction += Input.GetKey(inputComponent.upKey) ? 1 : 0;
moveComponent.direction -= Input.GetKey(inputComponent.downKey) ? 1 : 0;
}).Schedule(inputDeps);
return default;
}
Should be changed to :
protected override JobHandle OnUpdate(JobHandle inputDeps)
{
Entities.ForEach((ref Move_Component moveComponent, in Input_Component inputComponent) =>
{
moveComponent.direction = 0;
moveComponent.direction += Input.GetKey(inputComponent.upKey) ? 1 : 0;
moveComponent.direction -= Input.GetKey(inputComponent.downKey) ? 1 : 0;
}).Run();
return default;
}
版权声明
本文为[One Mr rabbit one]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210548406273.html
边栏推荐
- Why does ES6 need to introduce map when JS already has object type
- Browser - learning notes
- LeetCode 1351、统计有序矩阵中的负数
- Imitation Baidu map realizes the three buttons to switch the map mode by automatically shrinking the bottom
- Mathematical modeling column | Part 5: MATLAB optimization model solving method (Part I): Standard Model
- The ODB model calculates the data and outputs it to excel
- 內網滲透之DOS命令
- Handwritten Google's first generation distributed computing framework MapReduce
- Devaxpress report replay: complete the drawing of conventional two-dimensional report + histogram + pie chart
- Scripy tutorial - (2) write a simple crawler
猜你喜欢
Resolve the error - error identifier 'attr_ id‘ is not in camel case camelcase
【栈和队列专题】—— 滑动窗口
高薪程序员&面试题精讲系列91之Limit 20000加载很慢怎么解决?如何定位慢SQL?
vulnhub DC:1渗透笔记
[PTA] get rid of singles
What is the difference between a host and a server?
PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
上海回應“面粉官網是非法網站”:疏於運維被“黑”,警方已立案
Es keyword sorting error reason = fielddata is disabled on text fields by default Set fielddata = true on keyword in order
Case of the third day of go language development fresh every day project - news release system II
随机推荐
Latex formula
Scrapy教程 - (2)寫一個簡單爬蟲
Leetcode 1337. Row K with the weakest combat effectiveness in the matrix
After route link navigation, the sub page does not display the navigation style problem
Latest investigation and progress of building intelligence based on sati
Actual measurement of automatic ticket grabbing script of barley network based on selenium (the first part of the new year)
How to use PM2 management application? Come in and see
内网渗透之DOS命令
[PTA] l1-002 printing hourglass
DNS cloud school rising posture! Three advanced uses of authoritative DNS
[PTA] get rid of singles
star
How do BIM swindlers cheat? (turn)
Investigate why close is required after sqlsession is used in mybatties
vulnhub DC:1渗透笔记
LeetCode 994、腐烂的橘子
Numpy mathematical function & logical function
How to configure SSH public key in code cloud
ArcGIS JS version military landmark drawing (dovetail arrow, pincer arrow, assembly area) fan and other custom graphics
Monte Carlo py solves the area problem! (save pupils Series)