Пример #1
0
    private void Shoot()
    {
        SetRandomCurrTarget();
        if (_currTarget == null)
        {
            return;
        }
        GameObject go = Instantiate(_autoProjectilePrefab);

        go.transform.position = _shootingPoint.position;
        AutoProjectile projectile = go.GetComponent <AutoProjectile>();

        projectile.Init(_projectileLayer, _projectileSpeed, _currTarget.transform);
    }
    private void Shoot()
    {
        if (_currTarget == null)
        {
            return;
        }
        isAttack = true;
        _currTarget.GetComponent <DamagableEnemy>().IsAttacked = true;
        GameObject go = Instantiate(_autoProjectilePrefab);

        go.transform.position = _shootingPoint.position;
        AutoProjectile projectile = go.GetComponent <AutoProjectile>();

        projectile.Init(_projectileLayer, _projectileSpeed, _currTarget.transform);
    }