Beispiel #1
0
    void ManualShot()
    {
        NotShooting = false;
        //...setting shoot direction
        Vector3 shootDirection;

        shootDirection   = Input.mousePosition;
        shootDirection.z = 0.0f;
        shootDirection   = Camera.main.ScreenToWorldPoint(shootDirection);
        shootDirection   = shootDirection - transform.position;

        //Debug.Log("ShootDirection: " + shootDirection);
        //...instantiating the laser


        GameObject bulletGO = (GameObject)Instantiate(
            bulletPrefab,
            bulletSpawn.position,
            bulletSpawn.rotation);

        actualShoot = bulletGO;

        Laser_bullet LBullet = bulletGO.GetComponent <Laser_bullet>();

        LBullet.setRotation(transform.rotation);
        LBullet.setDamage(damage);


        laserCountdown = laserDuration;
    }
Beispiel #2
0
    void Fire()
    {
        NotShooting = false;

        GameObject bulletGO = (GameObject)Instantiate(
            bulletPrefab,
            bulletSpawn.position,
            bulletSpawn.rotation);

        actualShoot = bulletGO;

        Laser_bullet LBullet = bulletGO.GetComponent <Laser_bullet>();

        LBullet.setRotation(transform.rotation);
        LBullet.setDamage(damage);


        laserCountdown = laserDuration;
    }