/// <summary> /// Executes a given hitbox on all units at its location. /// </summary> /// <param name="hitbox">The hitbox to be executed.</param> private void CheckUnitsAtHitbox(Hitbox hitbox) { //Debug.Log("searching for units at " + hitbox.GetPosition()); List <OverworldObject> overworldObjects = GetOverworldObjectsAtPosition(hitbox.GetPosition()); foreach (OverworldObject overworldObject in overworldObjects) { if (overworldObject is Unit) { //Debug.Log("found: " + overworldObject); hitbox.ExecuteHitbox((Unit)overworldObject); } } }