public override bool HandleCollision(ProjectileHead p, RaycastHit2D hit) { // If you want different variations of portals (not both on the y axis) you'll need to change this! Vector3 newPos = new Vector3(secondPortal.transform.position.x + secondPortal.portalOffset.x, p.transform.position.y, 0); p.HandlePortal(newPos); return(false); }
public override bool HandleCollision(ProjectileHead p, RaycastHit2D hit) { if (sfx.Length > 0) { audio.clip = sfx[Random.Range(0, sfx.Length)]; audio.Play(); } p.HandleAbsorption(); return(false); }
public override bool HandleCollision(ProjectileHead p, RaycastHit2D hit) { if (sfx.Length > 0) { audio.clip = sfx[Random.Range(0, sfx.Length)]; audio.Play(); } p.HandleDeflection(hit.normal); return(true); }
public override bool HandleCollision(ProjectileHead p, RaycastHit2D hit) { if (sfx.Length > 0) { audio.clip = sfx[Random.Range(0, sfx.Length)]; audio.Play(); } if (Time.time - lastMeleeStart <= meleeDuration) { // Parry! damage player as well p.HandleMelee(hit.normal, prefab); } else { // Normal deflect p.HandleDeflection(hit.normal); } return(true); }
public abstract bool HandleCollision(ProjectileHead p, RaycastHit2D hit);