Comments (4)
ECS 机制下不适合在 Node 里加逻辑去控制。可以通过 Node.getComponentsInChildren() 找到渲染组件,然后去 disable 掉。
from cocos-engine.
ECS 机制下不适合在 Node 里加逻辑去控制。可以通过 Node.getComponentsInChildren() 找到渲染组件,然后去 disable 掉。
那能不能把这个标记加在RenderEntity中,Node.getComponentsInChildren()深度遍历的消耗也是很大的
from cocos-engine.
ECS 机制下不适合在 Node 里加逻辑去控制。可以通过 Node.getComponentsInChildren() 找到渲染组件,然后去 disable 掉。
那不还是遍历所有子节点 以及会执行 很多的 walk 吗? 性能太低了
from cocos-engine.
@minggo 希望正针对这个需求 进一步讨论下.
https://forum.cocos.org/t/topic/158944/ 我在论坛发了个帖子.
renderable
这个名字不好, 可以不用这个名字,但是希望有一个类似的属性.
如果不想增加属性, 希望能提供一个 便于 开发者重写的方式.
现在要在项目里 完全重写 walk 很难 而且walk 过于复杂.
比如
public walk (node: Node, level = 0): void {
if (!node.activeInHierarchy) {
return;
}
// ....
}
改为
public canWalk(node: Node, level = 0): void {
return node.activeInHierarchy
}
public walk (node: Node, level = 0): void {
if (!this.canWalk(node) {
return;
}
// ....
}
这样开发者如果有我这种特殊需求, 可以重写 canWalk.
from cocos-engine.
Related Issues (20)
- 移动正交相机,相机预览画面残留。
- [spine动画API] 缺少 `trackEntry.getAnimationLast/setAnimationLast()` 方法的声明
- Layout组件能否改成同帧刷新
- 统一bundle包中config.json文件名
- 微信小游戏电脑端插屏BUG: 缩放不对. HOT 1
- Label组件的阴影效果在 微信小游戏iPad 版本上无效 HOT 1
- 加载场景有概率报错
- [native] memory leak while changing label ( CacheMode: NONE) text. HOT 1
- angle cannot get correctly,
- Native build don't have the ability to make changes and collaborate with multiple people.
- [bug] Tween property type was changed to plain object
- 功能裁剪能否支持不同平台做不同设置
- The problem of not being able to effectively recognize the textureGrab function during the shader compilation with glslang.js when running WebGPU HOT 2
- [3.8.3] The image resources in tga format in the project cannot be exported as astc during the build process
- [3.8.x] There is a need to support the output of js sourceMap files when building projects for native platforms
- 自定义渲染管线中DevicePass里framebuffer中的texture可能失效
- 3.8.3的dragonBones引入后打印出来是个undefined
- In CocosEditor, FBX Animation will be from slow to quick
- [3.8.3] When js encounters an error code, it is unable to correctly output the code call stack information mapped by sourceMap HOT 2
- In CocosEditor and On web browser, FBX Animation Bake Rate changed, cannot take effect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cocos-engine.