Пример #1
0
    protected override void Shoot()
    {
        if (CreateBullet() && QueueShoot)
        {
            Game.ChangeQueue();
            Products[typeBullet].Reduce();
            Vector2 direction = MovementPart.position - Slider.transform.position;
            var     distance  = Vector2.Distance(MovementPart.position, Slider.transform.position) / maxStretch;

            // Хуйня но я заебался уже
            if (!(MovementPart.localRotation.eulerAngles.z > 360 - maxAngle || MovementPart.localRotation.eulerAngles.z < maxAngle))
            {
                if ((MovementPart.localRotation.eulerAngles.z < 360 - maxAngle))
                {
                    direction = MovementPart.position - rightBlock.position;
                }
                else
                {
                    direction = MovementPart.position - leftBlock.position;
                }
            }

            BulletComponent.Shoot(direction * Force * distance);

            catapultLine.SetPosition(1, catapultLine.GetPosition(0));
            Slider.transform.position = startSliderPosition;
            _clickedOn      = false;
            BulletComponent = null;
            StartCoroutine(RotateToStarWithDelay(0f));
        }
    }
Пример #2
0
    protected override void Shoot()
    {
        if (CreateBullet() && QueueShoot)
        {
            Game.ChangeQueue();
            Products[typeBullet].Reduce();

            Vector2 direction = MovementPart.position - Slider.transform.position;
            var     distance  = Vector2.Distance(MovementPart.position, Slider.transform.position) / maxStretch;

            var delay = 0.4f;
            ((Bullet_Laser)BulletComponent).delay   = delay;
            ((Bullet_Laser)BulletComponent).Maximum = 50f;

            BulletComponent.Shoot(MovementPart.transform.rotation.eulerAngles);

            catapultLine.SetPosition(1, catapultLine.GetPosition(0));
            Slider.transform.position = startSliderPosition;
            _clickedOn      = false;
            BulletComponent = null;
            StartCoroutine(RotateToStarWithDelay(delay));
        }
    }