dd
This commit is contained in:
@@ -61,7 +61,7 @@ entity.add(compObj)
|
||||
entity.remove(HelloComponent); // 组件对象会从实体身上移除并放入组件缓存池中
|
||||
```
|
||||
|
||||
- 删除组件但不删除组件对象:实际开发中,组件身上有很多属性,如果删除了后面再添加,属性值还原是个麻烦的问题,
|
||||
- 删除组件但不删除组件对象身上:实际开发中,组件有很多属性,如果删除了后面再添加,属性值还原是个麻烦的问题,
|
||||
remove方法可以删除组件,但是不真正从实体身上移除该组件对象,这样下次重新添加组件时还是会添加那个组件对象。
|
||||
```Typescript
|
||||
entity.remove(HelloComponent, false)
|
||||
|
||||
Reference in New Issue
Block a user