private bool GoldBodySlam() { float radius = controller.radius * 1.5f; Collider[] colliders = Physics.OverlapSphere(transform.position + controller.up * controller.height * 0.5f, radius); foreach (var col in colliders) { EnemyMachine machine = col.GetComponent <EnemyMachine>(); if (machine != null) { if (machine.GetStruck(Math3d.ProjectVectorOnPlane(controller.up, machine.transform.position - transform.position).normalized, 7.0f, 15.0f)) { sound.PlayImpact(); machine.MakeGold(); } } RollingBallGoldDestroy ball = col.GetComponent <RollingBallGoldDestroy>(); if (ball) { ball.BlowUp(); } } return(false); }
private bool BodySlam() { float radius = controller.radius * 1.5f; Collider[] colliders = Physics.OverlapSphere(transform.position, radius, EnemyLayerMask); foreach (var col in colliders) { EnemyMachine machine = col.GetComponent <EnemyMachine>(); if (machine != null && machine is GoombaMachine) { if (machine.GetStruck(Math3d.ProjectVectorOnPlane(controller.up, machine.transform.position - transform.position).normalized, 7.0f, 15.0f, 0.3f)) { sound.PlayImpact(); } } } return(false); }