diff --git a/Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs b/Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs index 9eb3725..e06433d 100644 --- a/Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs +++ b/Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs @@ -124,7 +124,7 @@ public class UIFloor : BaseToggle } if (MyTarget != null/* && floorNum == 0*/)//镜头拉近 { - cameraManager.SetCameraView(MyTarget.position, FollowCameraDistance,180,36); + cameraManager.SetCameraView(MyTarget.position, FollowCameraDistance,-110,52); } //if (RecordData.isRecording()) //{ @@ -176,6 +176,10 @@ public class UIFloor : BaseToggle CloneGameObjInfo[] objs = P_AllParent.GetComponentsInChildren(); for (int i = 0; i < objs.Length; i++) { + if (objs[i].gameObject == SelectedObjs.selectedObj || SelectedObjs.selectedCharacters.Contains( objs[i].gameObject)) + { + break; + } //if (string.IsNullOrEmpty(objs[i].buildNum)) //{//克隆在地面上的物体 // if (objs[i].floorNum > data.floorNum || diff --git a/Assets/Scripts/Common/RoomWaiting/COMMANDCENTER_FIRENOTIFY_SYNC.cs b/Assets/Scripts/Common/RoomWaiting/COMMANDCENTER_FIRENOTIFY_SYNC.cs index a54e5c7..2beaf40 100644 --- a/Assets/Scripts/Common/RoomWaiting/COMMANDCENTER_FIRENOTIFY_SYNC.cs +++ b/Assets/Scripts/Common/RoomWaiting/COMMANDCENTER_FIRENOTIFY_SYNC.cs @@ -6,6 +6,7 @@ using UnityEngine; using AX.Serialization; using UnityEngine.SceneManagement; using AX.NetworkSystem; +using System.Linq; public class COMMANDCENTER_FIRENOTIFY_SYNC : NetworkMessageBehaviour { @@ -38,9 +39,52 @@ public class COMMANDCENTER_FIRENOTIFY_SYNC : NetworkMessageBehaviour (u.UserInfo.Id, info)); } } + //SceneManager.LoadScene("Police"); - transform.parent.Find("Police").gameObject.SetActive(true); - UIManager.GetView().ShowPoliceSize(); + //再再这里判断是不是有重复时间,有的话开携程等待 + List> zhiHArrivetimes = new List>(); + List ZHID = new List(); + for (int i = 0; i < CurrentUserInfo.room.UserList.Count; i++) + {//筛选房间里的总支大队ID + if (CurrentUserInfo.room.UserList[i].Role==Role.总队指挥|| + CurrentUserInfo.room.UserList[i].Role == Role.支队指挥 || + CurrentUserInfo.room.UserList[i].Role == Role.大队指挥) + { + ZHID.Add(CurrentUserInfo.room.UserList[i].UserInfo.Id); + } + } + for (int i = 0; i < info.ArriveTimeList.Count; i++) + {//根据房间里的总支大id筛选到达时间里的总支大 + if (ZHID.Contains(info.ArriveTimeList[i].Key)) + { + zhiHArrivetimes.Add(info.ArriveTimeList[i]); + } + } + //根据到达时间分组 + var q = from p in zhiHArrivetimes group p by p.Value; + var timelist= q.ToList(); + for (int i = 0; i < timelist.Count; i++) + { + var pairlist = timelist[i].ToList(); + if (pairlist.Count > 1) + {//如果组里的个数大于一,也就是有两个及以上设置的时间是相同的 + for (int j = 0; j < pairlist.Count; j++) + { + if (CurrentUserInfo.mySelf.Id == pairlist[j].Key) + {//加0.5是考虑第一组也就是i=0的情况,没有加整数是考虑计算出来的数可能设置时间相同最后导致进场时间还是一样 + StartCoroutine(waitinto((i + 0.5f) * (j+0.5f))); + } + } + } + else + { + if (CurrentUserInfo.mySelf.Id == pairlist[0].Key) + { + StartCoroutine(waitinto(0)); + } + } + + } } //else if (CurrentUserInfo.role == Role.中队指挥) //{ @@ -65,4 +109,10 @@ public class COMMANDCENTER_FIRENOTIFY_SYNC : NetworkMessageBehaviour UIManager.GetView().ShowPoliceSize(); } } + IEnumerator waitinto(float time) + { + yield return new WaitForSeconds(time*0.2f); + transform.parent.Find("Police").gameObject.SetActive(true); + UIManager.GetView().ShowPoliceSize(); + } }