Exemple #1
0
    private void Die()
    {
        _isAlive = false;
        ExplosionController explosion = ExplosionManager.Get(explodeEffect);

        explosion.transform.position = transform.position;
        explosion.Explode();
        if (explodeSound)
        {
            AudioManager.PlayAtPoint(explodeSound, transform.position);
        }
        CancerManager.Recycle(this);
        GameSceneController.OnCancerDeath(identifierName);
    }
Exemple #2
0
    private void Die(string reason)
    {
        foreach (var weapon in weapons)
        {
            (weapon as ShooterController)?.CancelAttack();
        }
        gameObject.SetActive(false);
        ExplosionController explosion = ExplosionManager.Get(explodeEffect);

        explosion.transform.position = transform.position;
        explosion.Explode();
        onDeath?.Invoke(reason);
        if (_displayChemoTreatmentCoroutine != null)
        {
            StopCoroutine(_displayChemoTreatmentCoroutine);
        }
        _displayChemoTreatmentCoroutine = null;
    }
Exemple #3
0
    public void Recycle()
    {
        _isAlive = false;
        ExplosionController explosion = ExplosionManager.Get(explodeEffect);

        explosion.transform.position = transform.position;
        explosion.Explode();
        if (explodeSound)
        {
            AudioManager.PlayAtPoint(explodeSound, transform.position);
        }
        if (_isStunned)
        {
            StopCoroutine(_stunCoroutine);
        }
        _isStunned     = false;
        _stunCoroutine = null;
        if (_isAttacking)
        {
            CancelAttack();
        }
        EnemyManager.Recycle(this);
    }