public bool execute() { GameObject raw = logic.master.entityMap[logic.player.ahead]; if (raw != null) { MonoBehaviour[] scripts = raw.GetComponents <MonoBehaviour>(); foreach (MonoBehaviour mb in scripts) { IAttackable target = mb as IAttackable; if (target != null) { interaction.attack(logic.player, target); return(true); } } } return(false); }