Пример #1
0
    public override void Fire()
    {
        Transform[] bullets = new Transform[perCircle];

        for (int i = 0; i < perCircle; i++)
        {
            bullets[i] = Instantiate(bullet);

            float altAngle = (2 * Mathf.PI) / (float)perCircle / (float)spiraling * alt;

            Vector3 bulletVec = AngleMath.AngleToVector3(((2 * Mathf.PI) / (float)perCircle) * i + altAngle);
            bulletVec = bulletVec * bulletSpeed;

            bullets[i].transform.position = transform.position;
            bullets[i].GetComponent <UpdateBullet>().movement = bulletVec;
        }

        alt++;
        if (alt > spiraling)
        {
            alt = 1;
        }
    }