public IAbilityObject Spawn(Ability ability, float multiplier)
    {
        ProjectileBase instance = Instantiate(this);

        instance.Initialize(ability, Multiplier);

        return(instance);
    }
Exemple #2
0
    protected virtual void SpawnProjectile(ProjectileBase projectilePrefab)
    {
        ProjectileBase instance = Instantiate(projectilePrefab);

        instance.Initialize(AttackDamage, Color);

        float angle = Mathf.Atan2(TargetDirection.y, TargetDirection.x) * Mathf.Rad2Deg;

        instance.transform.position    = transform.position;
        instance.transform.eulerAngles = new Vector3(0, 0, angle);
    }
Exemple #3
0
    public void SpawnSeeker(Muzzle muzzle)
    {
        ProjectileBase instance = Instantiate(_prefab);

        instance.Initialize(_selectedWeapon.Value);

        instance.transform.position    = _weaponDirection.position;
        instance.transform.eulerAngles = _rotationAnchor * GetAngle(muzzle);

        _onFire.Raise();
    }