Exemplo n.º 1
0
        private void OnTriggerEnter2D(Collider2D collision)
        {
            IDamagable damagable = collision.gameObject.GetComponent <IDamagable>();

            if (damagable != null)
            {
                Debug.LogError("++Player " + PlayerPrefs.GetString(KeyStrings.PlayerPriorityServer));
                damagable.OnDamage(damage);
                if (OnHitParticleEffect != null)
                {
                    Instantiate(OnHitParticleEffect, transform.position, Quaternion.identity);
                }
                Destroy(this.gameObject);
            }
        }