Remove removes an entity from the AudioSystem
(basic ecs.BasicEntity)
| 145 | |
| 146 | // Remove removes an entity from the AudioSystem |
| 147 | func (a *AudioSystem) Remove(basic ecs.BasicEntity) { |
| 148 | delete := -1 |
| 149 | for index, e := range a.entities { |
| 150 | if e.BasicEntity.ID() == basic.ID() { |
| 151 | delete = index |
| 152 | break |
| 153 | } |
| 154 | } |
| 155 | if delete >= 0 { |
| 156 | a.entities = append(a.entities[:delete], a.entities[delete+1:]...) |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | // Update doesn't do anything since audio is run on it's own thread |
| 161 | func (a *AudioSystem) Update(dt float32) { |