/// <summary> /// Applies an explosion force to the colliding object. /// </summary> public void ApplyForce(int power) { Vector3 position = transform.position; float radius = 5f; Collider[] colliders = Physics.OverlapSphere(position, radius); foreach (Collider hit in colliders) { navMove move = hit.GetComponent<navMove>(); if (move != null) { move.Stop(); hit.GetComponent<NavMeshAgent>().enabled = false; hit.isTrigger = false; } Rigidbody rb = hit.GetComponent<Rigidbody>(); if (rb != null) rb.AddExplosionForce(power, position, radius, 100.0F); } }
// Token: 0x060006EA RID: 1770 RVA: 0x0002D598 File Offset: 0x0002B998 public void ApplyForce(int power) { Vector3 position = base.transform.position; float num = 5f; Collider[] array = Physics.OverlapSphere(position, num); foreach (Collider collider in array) { navMove component = collider.GetComponent <navMove>(); if (component != null) { component.Stop(); collider.GetComponent <NavMeshAgent>().enabled = false; collider.isTrigger = false; } Rigidbody component2 = collider.GetComponent <Rigidbody>(); if (component2 != null) { component2.AddExplosionForce((float)power, position, num, 100f); } } }
public void StopAI() { //when the level is complete or the player dies, the AI should be stoppped WaypointScript.Stop(); }