private void Create() { AsteroidController asteroidController = AsteroidPool.GetAsteroid(); asteroidController.Move(); asteroidController.asteroidView.ScoreEvent += OnScore; }
public void Spawn() { // генерируем пул астероидов Vector2 maxPosition = new Vector2(rightPoint, upPoint); AsteroidPool.Initialize(asteroidData.Type, asteroidData, maxPosition); // генерируем пул пуль BulletPool.Initialize(bullet.Type, bullet, bulletPosition); StartCoroutine("SpawnAsteroid"); }
private void OffAsteroid() { AsteroidPool.PutAsteroid(this); }
private void OnDestroyAsteroid() { AsteroidPool.PutAsteroid(this); }