Exemplo n.º 1
0
    protected void Beam(float _attackTime, Barrage _barrage)
    {
        Vector3        pos        = this.Trans.position;
        int            beamNumber = this.SearchAvailableBullet(this.beams);
        QueenBeeBullet bullet     = this.beams[beamNumber];

        bullet.BulletType = _barrage;
        bullet.Bullet.transform.position = pos;
        bullet.AttackTime = _attackTime;
        bullet.Bullet.gameObject.SetActive(true);
    }
Exemplo n.º 2
0
    protected void Funnel(Vector2 _toPos, float _moveSecond, Barrage _barrage)
    {
        Vector3        pos            = this.Trans.position;
        float          distance       = Vector2.Distance(pos, _toPos);
        int            childBeeNumber = this.SearchAvailableBullet(this.childBees);
        QueenBeeBullet bullet         = this.childBees[childBeeNumber];

        bullet.BulletType = _barrage;
        bullet.Bullet.transform.position = pos;
        bullet.HitPoint             = 5;
        bullet.ToPos                = _toPos;
        bullet.ToMoveSpeed          = distance / _moveSecond;
        bullet.VectorMyselfPosition = new Vector2(_toPos.x - pos.x, _toPos.y - pos.y).normalized;
        bullet.MovingFlag           = true;
        bullet.Bullet.gameObject.SetActive(true);
        this.occupiedFunnel.Add(bullet);
    }
Exemplo n.º 3
0
    protected void Suicide(int _fanNum, float _radius, Barrage _barrage)
    {
        Vector3 pos   = this.Trans.position;
        float   angle = 360.0f / (_fanNum - 1) * Mathf.Deg2Rad;

        for (int i = 0; i < _fanNum; i += 1)
        {
            int            childBeeNumber = this.SearchAvailableBullet(this.childBees);
            QueenBeeBullet bullet         = this.childBees[childBeeNumber];
            bullet.Bullet.transform.position = pos;
            bullet.Angle         = angle * i;
            bullet.StartPosition = pos;
            bullet.BulletType    = _barrage;
            bullet.MaxRadius     = _radius;
            bullet.Bullet.gameObject.SetActive(true);
            this.occupiedFunnel.Add(bullet);
        }
    }
Exemplo n.º 4
0
    protected void LeftFan(int _fanNum, Barrage _barrage)
    {
        Vector3 pos = this.Trans.position;

        pos.x -= 10.5f;
        int appearSpace = (this.maxRad - this.minRad) / (_fanNum - 1);

        for (int i = 0; i < _fanNum; i += 1)
        {
            int            needleNumber = this.SearchAvailableBullet(this.needles);
            QueenBeeBullet bullet       = this.needles[needleNumber];
            bullet.BulletType = _barrage;
            bullet.Bullet.transform.position = pos;
            bullet.Bullet.transform.rotation = new Quaternion(0.7f, 0.0f, 0.0f, 0.7f);
            bullet.Bullet.transform.Rotate(new Vector3(0, 1, 0), this.minRad + i * appearSpace);
            bullet.Bullet.SetActive(true);
        }
    }
    private void LinkedAttack()
    {
        if (this.Attack)
        {
            Vector3        pos    = this.Trans.position;
            QueenBeeBullet bullet = this.ChildNeedles[this.SearchBullet(this.ChildNeedles)];
            bullet.BulletType = Barrage.Fan;
            bullet.Bullet.transform.position = pos;
            Vector3 playerPos;
            if (this.Bullet.tag.Equals("Enemy1"))
            {
                playerPos = PlayerManager.GameObjectPl1.transform.position;
            }
            else
            {
                playerPos = PlayerManager.GameObjectPl2.transform.position;
            }

            bullet.Trans.rotation = Quaternion.LookRotation(playerPos - this.Trans.position);
            bullet.Trans.Translate(Vector3.forward * this.BulletSpeed * Time.deltaTime);
            bullet.Bullet.SetActive(true);
            this.Attack = false;
        }
    }