void IEcsRunSystem.Run() { // add your run code here. foreach (var index in _filterBullet) { ref GameEntityRef gameEntityRefComponent = ref _filterBullet.Get3(index); Bullet bullet = (Bullet)gameEntityRefComponent.value; bullet.MoveToPool(); _filterBullet.GetEntity(index).Del <Collided>(); }
void IEcsRunSystem.Run() { // add your run code here. foreach (var index in _filterAsteroid) { ref GameEntityRef gameEntityRefComponent = ref _filterAsteroid.Get3(index); Asteroid asteroid = (Asteroid)gameEntityRefComponent.value; asteroid.Boom(); _filterAsteroid.GetEntity(index).Get <Exploded>(); _filterAsteroid.GetEntity(index).Del <Collided>(); lvl.AsteroidsDestroyed++; Static.ui.goal.text = lvl.AsteroidsDestroyed.ToString() + "/" + lvl.AsteroidsGoal.ToString(); AudioSource.PlayClipAtPoint(config.explosion, Vector3.zero); }