Esempio n. 1
0
 private void ShootToTarget()
 {
     if (_target != null)
     {
         Vector2    direction = _target.GetTarget().transform.position - transform.position;
         IDirigible bullet    = (Instantiate(_data.bulletPrefab, shootTransform.position, Quaternion.identity)).GetComponent <IDirigible>();
         bullet.SetDirection(direction);
     }
 }
Esempio n. 2
0
    public void Shoot()
    {
        Vector2 direction = _crosshair.transform.position - transform.position;

        if (actualWeapon != null)
        {
            IDirigible bullet = (Instantiate(actualWeapon.bulletPrefab, _initialPoint.position, Quaternion.identity)).GetComponent <IDirigible>();
            bullet.SetDirection(direction);


            // TODO
            // Core.Camera.Shake(actualWeapon.preset);
            ProCamera2DShake.Instance.Shake("PistolBullet");
        }
    }