void OnTriggerEnter2D(Collider2D objeto) { if (layerCollision == (layerCollision | (1 << objeto.gameObject.layer))) { if (!firstShot) { if (typeEffect.Equals(TypeEffect.OneEffect)) { GetComponent <Rigidbody2D> ().AddForce(forceEffect); firstShot = true; } else { GetComponent <Rigidbody2D> ().AddForce(forceEffect); } if (GetComponentInChildren <Collider2D>().Equals(objeto)) { GetComponent <Rigidbody2D> ().velocity = Vector2.zero; } } } }