public void OnPlayAttack(object[] all_params) { int unit_id = (int)all_params[0]; int target_unit_id = (int)all_params[1]; HeroUnit unit = GetHeroUnit(unit_id); BaseUnit target = GetUnit(target_unit_id); if (unit != null && target != null) { unit.PlayAttack(target); } }