void ClearLevelImmediate() { foreach (ILevelObject obj in GetCurrentLevelObjects()) { SafeDestroy.DestroyGameObject(obj.GetTransform); } }
public virtual void DeathEffect(float deathEffectTime_) { if (Application.isPlaying) { Tweener t = transform.DOScale(Vector3.zero, deathEffectTime_); t.SetEase(_blockProperties._blockSpawnEaseType); } SafeDestroy.DestroyGameObject(this, deathEffectTime_); }
public void DeathEffect(float deathEffectTime_) { if (Application.isPlaying) { Tweener t = transform.DOScale(Vector3.zero, deathEffectTime_); t.SetEase(_spawnEase); OnDeath(); } SafeDestroy.DestroyGameObject(this, 2.0f); }
private void OnCollisionEnter(Collision other) { _health = other.gameObject.GetComponent <Health> (); if (_health != null) { _health.Damage(_damage); } SafeDestroy.DestroyGameObject(this); }
void DestroyAllChildren() { if (_isEditMode) { for (int i = transform.childCount - 1; i >= 0; i--) { SafeDestroy.DestroyGameObject(transform.GetChild(0)); } } else { foreach (Transform tran in transform) { Destroy(tran.gameObject); } } }
void DestroyWall(Vector3 pos_) { _colliders = Physics.OverlapSphere(pos_, 0.2f, _wallsLayerMask); if (_isEditMode) { for (int i = 0; i < _colliders.Length; i++) { SafeDestroy.DestroyGameObject(_colliders[i]); } } else { foreach (Collider col in _colliders) { Destroy(col.gameObject); } } }