예제 #1
0
        public override void Fire()
        {
            GetProjectileFromPool getProjectile = FloaterBulletPool.Instance.Get;

            PlayerShip player = PlayerShip.Instance;

            Vector2 direction2d;

            if (player != null)
            {
                Vector3 direction =
                    player.transform.position - transform.position;

                direction.Normalize();

                direction2d = new Vector2(direction.x, direction.y);
            }
            else
            {
                direction2d = Vector2.up;
            }


            Fire(getProjectile, direction2d);
        }
        /// <summary>
        /// Fires a PlasmaBolt.
        /// </summary>
        public override void Fire()
        {
            GetProjectileFromPool getProjectile = PlasmaBoltPool.Instance.Get;

            Vector3 direction  = transform.up;
            Vector2 direction2 = new Vector2(direction.x, direction.y);

            Fire(getProjectile, direction2);
        }