public void Attack()
    {
        if (player == null)
        {
            player = boss.player.GetComponent <Player>();
        }

        Vector2 direction = ((player.transform.position + player.GetDirection() * Random.Range(0, 2)) - rotator.position).normalized;
        float   angle     = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;

        rotator.eulerAngles = Vector3.forward * angle;
        WaterBulletCone bullets = Instantiate(bulletPattern, shootPoint.position, shootPoint.rotation).GetComponent <WaterBulletCone>();

        bullets.mode = "explode";
    }
Exemple #2
0
    public void Attack()
    {
        if (player == null)
        {
            player = boss.player.GetComponent <Player>();

            if (enableFieldBlur)
            {
                BlurredVision fieldBlur = Instantiate(steam).GetComponent <BlurredVision>();
                fieldBlur.SetTargets(player.gameObject, gameObject);
            }
        }

        Vector2 direction = ((player.transform.position + player.GetDirection() * Random.Range(0, 2)) - rotator.position).normalized;
        float   angle     = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;

        rotator.eulerAngles = Vector3.forward * angle;
        WaterBulletCone bullets = Instantiate(bulletPattern, shootPoint.position, shootPoint.rotation).GetComponent <WaterBulletCone>();

        bullets.mode  = "explode";
        bullets.speed = shotSpeed;
    }