Beispiel #1
0
        /// <summary>
        /// Анимация выстрела
        /// </summary>
        public void AnimateFire(int bulletSortingOrder, float bulletSpeed)
        {
            BulletView bullet = BulletPool.GetBullet();

            bullet.Shot(bulletSortingOrder, bulletSpeed);
            if (!shotSND.isPlaying)
            {
                shotSND.Play();
            }
        }
        public void Spawn()
        {
            // генерируем пул астероидов
            Vector2 maxPosition = new Vector2(rightPoint, upPoint);

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

            // генерируем пул пуль
            BulletPool.Initialize(bullet.Type, bullet, bulletPosition);
            StartCoroutine("SpawnAsteroid");
        }
Beispiel #3
0
 private void OnBecameInvisible()
 {
     BulletPool.PutBullet(this);
 }