// Peforms any special force synchronisation required for different types of objects void AddExplosiveForce(Rigidbody mob) { // Use the mobs z position to stop the force causing enemies to move upwards all the time Vector3 position = new Vector3(transform.position.x, transform.position.y, mob.transform.position.z); mob.AddCustomExplosionForce(position, m_aoeRange, m_aoeMinExplosiveForce, m_aoeMaxExplosiveForce); switch (mob.gameObject.layer) { case Layers.asteroid: SyncAsteroid(mob); break; case Layers.player: SyncPlayer(mob); break; } }