* Pause dynamic behavior associated with entity such as dynamic components and animations. * Tell all children entities to also pause.
()
| 516 | * Tell all children entities to also pause. |
| 517 | */ |
| 518 | pause () { |
| 519 | var entities; |
| 520 | var i; |
| 521 | var key; |
| 522 | |
| 523 | if (!this.isPlaying) { return; } |
| 524 | this.isPlaying = false; |
| 525 | |
| 526 | // Sleep all components. |
| 527 | for (key in this.components) { this.components[key].pause(); } |
| 528 | |
| 529 | // Tell all child entities to pause. |
| 530 | entities = this.getChildEntities(); |
| 531 | for (i = 0; i < entities.length; i++) { entities[i].pause(); } |
| 532 | |
| 533 | this.emit('pause'); |
| 534 | } |
| 535 | |
| 536 | /** |
| 537 | * Deals with updates on entity-specific attributes (i.e., components and mixins). |
no test coverage detected