public void onQuit(m_monster_quit_toc vo) { if (prepareQuit.IndexOf(vo.monsterid) == -1) { //添加到删除列表 prepareQuit.Add(vo.monsterid); } Monster monster = SceneUnitMgr.monsterHash[vo.monsterid+""] as Monster; int timeOutKey=0; if (monster != null) { object[] obj = {vo}; //timeOutKey = LoopManager.setTimeout(sendToRoleState, 1000, obj); quitTimeOut[monster.id+""] = timeOutKey; } }
private void sendToRoleState(m_monster_quit_toc vo) { int qIndex = prepareQuit.IndexOf(vo.monsterid); if (qIndex != -1) { //只有在删除列表里面的怪才能删除,否则此怪已经重生 prepareQuit.Remove(qIndex); clearQuitTimeOut(vo.monsterid); _view.removeUnit(vo.monsterid, SceneUnitType.MONSTER_TYPE); } }