public void Tick() { if (camp_users_.ContainsKey((int)CampIdEnum.Blue)) { List <UserInfo> list = camp_users_[(int)CampIdEnum.Blue]; int ct = list.Count; for (int i = 0; i < ct; ++i) { UserInfo user = list[i]; user.PrepareUpdateSight(); } } if (camp_users_.ContainsKey((int)CampIdEnum.Red)) { List <UserInfo> list = camp_users_[(int)CampIdEnum.Red]; int ct = list.Count; for (int i = 0; i < ct; ++i) { UserInfo user = list[i]; user.PrepareUpdateSight(); } } for (LinkedListNode <NpcInfo> node = npc_manager_.Npcs.FirstValue; null != node; node = node.Next) { NpcInfo npc = node.Value; if (null != npc) { npc.PrepareUpdateSight(); } } if (camp_users_.ContainsKey((int)CampIdEnum.Blue)) { List <UserInfo> list = camp_users_[(int)CampIdEnum.Blue]; int ct = list.Count; for (int i = 0; i < ct; ++i) { UserInfo user = list[i]; CalcSight(user); } } if (camp_users_.ContainsKey((int)CampIdEnum.Red)) { List <UserInfo> list = camp_users_[(int)CampIdEnum.Red]; int ct = list.Count; for (int i = 0; i < ct; ++i) { UserInfo user = list[i]; CalcSight(user); } } for (LinkedListNode <NpcInfo> node = npc_manager_.Npcs.FirstValue; null != node; node = node.Next) { NpcInfo npc = node.Value; if (null != npc) { //先保留对塔的计算(应该没必要) if (npc.NpcType == (int)NpcTypeEnum.PvpTower) { npc.CurBlueCanSeeMe = true; npc.CurRedCanSeeMe = true; } CalcSight(npc); } } }