Ejemplo n.º 1
0
    public void CreateBullet(EnemyDatabase.BulletInfo bulletInfo)
    {
        Vector2      pos = tp.position;
        BulletScript bs  = Instantiate(Test.instance.bulletBase, shotPoints[bulletInfo.shotPoint] + pos, Quaternion.identity).GetComponent <BulletScript>();

        bs.Init(bulletInfo.angle, bulletInfo.speed, bulletInfo.angleAccel, bulletInfo.speedAccel);
    }
Ejemplo n.º 2
0
    void AttackToEnemy()
    {
        _attackDelayHold += Time.deltaTime;
        if (_attackDelayHold >= attackDelay)
        {
            print("Attack to :" + _target.tag);

            GameObject   _bullet     = Instantiate(bullet, weapon.position, Quaternion.identity);
            BulletScript _bullScript = _bullet.GetComponent <BulletScript>();
            _bullScript.Init(_target, speed, damage);


            _attackDelayHold = 0;
        }
    }
Ejemplo n.º 3
0
    public void CreateBullet(EnemyDatabase.BulletInfo bulletInfo)
    {
        BulletScript bs = Instantiate(bulletOrigin, currInfo.shotPoint[bulletInfo.shotPoint], Quaternion.identity).GetComponent <BulletScript>();

        bs.Init(bulletInfo.angle, bulletInfo.speed, bulletInfo.angleAccel, bulletInfo.speedAccel);
    }
Ejemplo n.º 4
0
    private void SpawnBullet(Vector3 spawnPoint, float velocity, float angle)
    {
        BulletScript bullet = (BulletScript)Instantiate(bulletPrefab, spawnPoint, Quaternion.identity);

        bullet.Init(gameObject.tag, velocity, angle);
    }