* 获取一个空闲粒子 * Get an inactive particle
()
| 180 | * Get an inactive particle |
| 181 | */ |
| 182 | spawn(): Particle | null { |
| 183 | for (const p of this._particles) { |
| 184 | if (!p.alive) { |
| 185 | p.alive = true; |
| 186 | this._activeCount++; |
| 187 | return p; |
| 188 | } |
| 189 | } |
| 190 | return null; |
| 191 | } |
| 192 | |
| 193 | /** |
| 194 | * 回收粒子 |
no outgoing calls
no test coverage detected