| | |
| | | if (!isRunOnce) |
| | | { |
| | | isRunOnce = true; |
| | | bool isLastOne = false; |
| | | int index = 0; |
| | | int total = deadPackList.Count; |
| | | foreach (var deadPack in deadPackList) |
| | | { |
| | | index++; |
| | | isLastOne = index >= total; |
| | | BattleObject deadObj = battleField.battleObjMgr.GetBattleObject((int)deadPack.ObjID); |
| | | deadObj.OnDeath(OnDeathAnimationEnd); |
| | | deadObj.OnDeath(() => |
| | | { |
| | | OnDeathAnimationEnd(deadObj); |
| | | |
| | | if (isLastOne) |
| | | { |
| | | isFinish = true; |
| | | } |
| | | }); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | } |
| | | |
| | | private void OnDeathAnimationEnd() |
| | | private void OnDeathAnimationEnd(BattleObject deadObj) |
| | | { |
| | | // 只有主线掉落物品 |
| | | if (battleField.MapID == 1 || battleField.MapID == 2) |
| | | { |
| | | battleObject.PerformDrop(); |
| | | deadObj.PerformDrop(); |
| | | } |
| | | // 掉落物品 增加经验 |
| | | |
| | | isFinish = true; |
| | | } |
| | | } |