Ejemplo n.º 1
0
    protected override void Shot(Monster monster)
    {
        base.Shot(monster);

        GameObject go     = Game.Instance.ObjectPool.Spawn("BallBullet");
        BallBullet bullet = go.GetComponent <BallBullet>();

        bullet.transform.position = _shotPoint.position;
        bullet.Load(this.UseBulletId, this.Level, this.MapRect, monster);
    }
Ejemplo n.º 2
0
    public override void Attack(Monster monster)
    {
        base.Attack(monster);

        GameObject go     = Game.Instance.ObjectPool.Spawn("BallBullet");
        BallBullet bullet = go.GetComponent <BallBullet>();

        bullet.transform.position = transform.position;
        bullet.Load(this.UseBulletID, this.Level, this.MapRect, monster);
    }
Ejemplo n.º 3
0
    public override void Shot(Enemy enemy)
    {
        base.Shot(enemy);

        for (int i = 0; i < BulletCount; i++)
        {
            //发射方向
            float   radians = (Mathf.PI * 2f / BulletCount) * i;
            Vector3 dir     = new Vector3(Mathf.Cos(radians), Mathf.Sin(radians), 0f);

            //产生子弹
            GameObject go     = Game.Instance.ObjectPool.Spawn("BallBullet");
            BallBullet bullet = go.GetComponent <BallBullet>();
            bullet.transform.position = m_ShotPoint.position;
            bullet.Load(this.UseBulletID, this.Level, this.MapRect, dir);
        }
    }