当前位置:网站首页>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
边栏推荐
- LeetCode 20、有效的括号
- Introduction to standardization, regularization and normalization
- Automatically fill in body temperature and win10 task plan
- Handwritten Google's first generation distributed computing framework MapReduce
- JSX syntax rules
- LeetCode 116. 填充每个节点的下一个右侧节点指针
- SQL Server Connectors By Thread Pool | DTSQLServerTP plugin instructions
- Recognition of high-speed road signs by Matlab using alexnet
- LeetCode 74、搜索二维矩阵
- 內網滲透之DOS命令
猜你喜欢
ArcGIS JS version military landmark drawing (dovetail arrow, pincer arrow, assembly area) fan and other custom graphics
"Meta function" of tidb 6.0: what is placement rules in SQL?
Imitation Baidu map realizes the three buttons to switch the map mode by automatically shrinking the bottom
LeetCode 116. 填充每个节点的下一个右侧节点指针
Some basic knowledge of devexpress report development
Case of the third day of go language development fresh every day project - news release system II
Shanghai responded that "flour official website is an illegal website": neglect of operation and maintenance has been "hacked", and the police have filed a case
Rt-1052 learning notes - GPIO architecture analysis
Latest investigation and progress of building intelligence based on sati
SQL Server connectors by thread pool 𞓜 instructions for dtsqlservertp plug-in
随机推荐
Go zero framework database avoidance Guide
How can matlab obtain the truncated image in trainingimagelabeler
Zdns was invited to attend the annual conference of Tencent cloud basic resources and share the 2020 domain name industry development report
【SQL】字符串系列2:将一个字符串根据特定字符分拆成多行
Shanghai responded that "flour official website is an illegal website": neglect of operation and maintenance has been "hacked", and the police have filed a case
Leetcode 542, 01 matrix
【PTA】L1-006 连续因子
JDBC database addition, deletion, query and modification tool class
LeetCode 542、01 矩阵
After route link navigation, the sub page does not display the navigation style problem
Leetcode 994, rotten orange
三十一. `prototype`显示原型属性和`__proto__`隐式原型属性
[PTA] l1-002 printing hourglass
Flex layout
Tensorflow 2 basic operation dictionary
Experience of mathematical modeling in 18 year research competition
【PTA】L1-002 打印沙漏
The ODB model calculates the data and outputs it to excel
Building the tide, building the foundation and winning the future -- the successful holding of zdns Partner Conference
Preliminary understanding of cache elimination algorithm (LRU and LFU)