Exemple #1
0
    protected void OnDestroy()
    {
// destry data for mission..

        ExplosionCache.Clear();
        ExplosionCache = null;
    }
 public void Explode(Collider2D target, AttackType type)
 {
     try
     {
         sprite.sprite = null;
         explosion     = ExplosionCache.GetInstance().GetExplosion(this.type.ofensiveType);
         if (explosion != null)
         {
             explosion.Explode(target, warHead, type);
             if (animator.runtimeAnimatorController != null)
             {
                 //Debug.Log("?");
                 animator.SetTrigger("Explosion");
             }
         }
     }
     catch (Exception e)
     {
         Debug.Log("  " + e);
     }
 }