private void Splash() { PoisonSplash tmp = GameObject.Instantiate(splashPrefab, target.transform.position, Quaternion.identity); tmp.Damage = splashDamage; Physics2D.IgnoreCollision(target.GetComponent <Collider2D>(), tmp.GetComponent <Collider2D>()); }
/// <summary> /// Spawns a splash on the ground /// </summary> private void Splash() { //Spawns the splash at the monster's position PoisonSplash tmp = GameObject.Instantiate(splashPrefab, target.transform.position, Quaternion.identity) as PoisonSplash; //Sets the damage equal to the splash damage tmp.Damage = splashDamage; //Makes sure that the monster that spawned the splash can't collide with it Physics2D.IgnoreCollision(target.GetComponent <Collider2D>(), tmp.GetComponent <Collider2D>()); }