Exemple #1
0
 void ClearLevelImmediate()
 {
     foreach (ILevelObject obj in GetCurrentLevelObjects())
     {
         SafeDestroy.DestroyGameObject(obj.GetTransform);
     }
 }
Exemple #2
0
 public virtual void DeathEffect(float deathEffectTime_)
 {
     if (Application.isPlaying)
     {
         Tweener t = transform.DOScale(Vector3.zero, deathEffectTime_);
         t.SetEase(_blockProperties._blockSpawnEaseType);
     }
     SafeDestroy.DestroyGameObject(this, deathEffectTime_);
 }
Exemple #3
0
 public void DeathEffect(float deathEffectTime_)
 {
     if (Application.isPlaying)
     {
         Tweener t = transform.DOScale(Vector3.zero, deathEffectTime_);
         t.SetEase(_spawnEase);
         OnDeath();
     }
     SafeDestroy.DestroyGameObject(this, 2.0f);
 }
Exemple #4
0
    private void OnCollisionEnter(Collision other)
    {
        _health = other.gameObject.GetComponent <Health> ();
        if (_health != null)
        {
            _health.Damage(_damage);
        }

        SafeDestroy.DestroyGameObject(this);
    }
Exemple #5
0
 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);
         }
     }
 }
Exemple #6
0
    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);
            }
        }
    }