예제 #1
0
        private void Create()
        {
            AsteroidController asteroidController = AsteroidPool.GetAsteroid();

            asteroidController.Move();
            asteroidController.asteroidView.ScoreEvent += OnScore;
        }
예제 #2
0
        public void Spawn()
        {
            // генерируем пул астероидов
            Vector2 maxPosition = new Vector2(rightPoint, upPoint);

            AsteroidPool.Initialize(asteroidData.Type, asteroidData, maxPosition);

            // генерируем пул пуль
            BulletPool.Initialize(bullet.Type, bullet, bulletPosition);
            StartCoroutine("SpawnAsteroid");
        }
예제 #3
0
 private void OffAsteroid()
 {
     AsteroidPool.PutAsteroid(this);
 }
예제 #4
0
 private void OnDestroyAsteroid()
 {
     AsteroidPool.PutAsteroid(this);
 }