public void takeAShot()
 {
     if (isFragile)
     {
         hit = true;
         if (hit)
         {
             meshDestroy.DestroyMesh();
         }
     }
 }
예제 #2
0
 void OnDeath()
 {
     if (!_isAlive)
     {
         return;
     }
     _currentState = State.Idle;
     _isAlive      = false;
     _meshDestroyer.DestroyMesh();
     _movementController.StopMovement();
 }
예제 #3
0
    public void OnDeath()
    {
        if (!_isPlayerAlive)
        {
            return;
        }

        _isPlayerAlive = false;
        _meshController.DestroyMesh();
        _charController.isTrigger = true;
        UIManager.instance.ToggleGameMenu(true);
    }
예제 #4
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.tag == "DestroyAble" && HasCrown)
     {
         if (collision.gameObject.GetComponent <MeshDestroy>() == null)
         {
             destructionParticle.Emit(10);
             CameraShake.instance?.Shake(.5f);
             AudioManager.instance?.PlaySound(AudioEffect.destruction, .5f);
             MeshDestroy md = collision.gameObject.AddComponent <MeshDestroy>();
             md.sliced = true;
             md.DestroyMesh();
         }
     }
 }
예제 #5
0
    //When the enemy dies play a VFX and either cut/crumble depending on the enemy and attack, or just deactivate.
    private void Death()
    {
        FindObjectOfType <TimedCourse>().CountEnemies();
        Destroy(Instantiate(vfx, transform.position, transform.rotation), 2); //have vfx self destroy later
        MeshDestroy crumbleEffect = GetComponent <MeshDestroy>();

        if (crumbleEffect)
        {
            crumbleEffect.DestroyMesh(cutDirection, cutPoint, canCutChild);
        }
        else
        {
            gameObject.SetActive(false);
            //Destroy(gameObject);
        }
    }
예제 #6
0
 public void DestroyObject()
 {
     _meshDestroy.DestroyMesh();
 }