public void takeAShot() { if (isFragile) { hit = true; if (hit) { meshDestroy.DestroyMesh(); } } }
void OnDeath() { if (!_isAlive) { return; } _currentState = State.Idle; _isAlive = false; _meshDestroyer.DestroyMesh(); _movementController.StopMovement(); }
public void OnDeath() { if (!_isPlayerAlive) { return; } _isPlayerAlive = false; _meshController.DestroyMesh(); _charController.isTrigger = true; UIManager.instance.ToggleGameMenu(true); }
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(); } } }
//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); } }
public void DestroyObject() { _meshDestroy.DestroyMesh(); }