* 每一次游戏循环调用,可以做一些游戏操作,控制改变一些组件属性。 * * Called by every loop, can do some operation, change some property or other component property.
(e)
| 109 | * Called by every loop, can do some operation, change some property or other component property. |
| 110 | */ |
| 111 | update(e) { |
| 112 | const changes = this.componentObserver.clear(); |
| 113 | for (const changed of changes) { |
| 114 | if (changed) { |
| 115 | this.componentChanged(changed); |
| 116 | } |
| 117 | } |
| 118 | this.engine.update(e); |
| 119 | } |
| 120 | |
| 121 | componentChanged(changed: ComponentChanged) { |
| 122 | if (changed.component instanceof Physics) { |
nothing calls this directly
no test coverage detected