private void OnRemoveSceneObj(KProtoBuf buffer) { S2C_REMOVE_SCENE_OBJ respond = buffer as S2C_REMOVE_SCENE_OBJ; Debug.LogWarningFormat("====》删除UId为{0}的实体", respond.objID); if (DropItemManager.Instance.CheckDropItemPickUpSuccess(respond.objID)) { //Debug.LogErrorFormat("OnRemoveSceneObj 1 {0}", respond.objID); DropItemManager.Instance.DestoryChestGameObject(respond.objID); UIManager.Instance.StartCoroutine(DelayToRemoveEntityBecauseOfDropItem(respond.objID)); } else { BaseEntity baseEntity = m_EntityManager.GetEntityById <BaseEntity>(respond.objID); ShipItemsProxy shipItemsProxy = GameFacade.Instance.RetrieveProxy(ProxyName.ShipItemsProxy) as ShipItemsProxy; shipItemsProxy.RemoveShipItems(respond.objID); if (baseEntity == null) { Debug.LogErrorFormat("客户端无法找到UID为{0}的实体", respond.objID); return; } ulong uid = 0; if (baseEntity.GetHeroType() == KHeroType.htPlayer) { uid = baseEntity.GetPlayerId(); } //NetworkManager.Instance.GetDropItemController().GetDropItemManager().AddDestroyEffect(respond.objID); m_EntityManager.RemoveEntity(respond.objID); GameFacade.Instance.SendNotification(NotificationName.MSG_TEAM_BATTLE_UPDATE, uid); //发送组队队员离开 } }
private void NotifyRemoveSceneObj(KProtoBuf buf) { S2C_REMOVE_SCENE_OBJ respond = buf as S2C_REMOVE_SCENE_OBJ; //Debug.LogError("删除 hero " + respond.objID); SceneEntity removeObj = GetSceneObject(respond.objID) as SceneEntity; GameObject obj = null; if (null == removeObj) { log.Error("can not delete hero " + respond.objID); return; } obj = removeObj.gameObject; try { RemoveSceneObject(respond); } catch (Exception e) { GameObject.Destroy(obj); throw e; } //GameObject.Destroy(obj); }
/// <summary> /// 删除怪物信息 /// </summary> public void RemoveMonster(S2C_REMOVE_SCENE_OBJ msg) { uint objID = msg.objID; if (m_NearbyMonsterList.Contains(objID)) { m_NearbyMonsterList.Remove(objID); } if (m_MonsterPos.ContainsKey(objID)) { m_MonsterPos.Remove(objID); } Destroy(objID); }
private void OnRemoveMonster(KProtoBuf buf) { S2C_REMOVE_SCENE_OBJ msg = buf as S2C_REMOVE_SCENE_OBJ; GetMSAIBossProxy().RemoveMonster(msg); }
public void RemoveSceneObject(S2C_REMOVE_SCENE_OBJ respond) { DisposeSceneObject(respond.objID); }