Browse Source

同步修改

symybb
曹衍涛 3 years ago
parent
commit
2c81264413
  1. 8
      Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs
  2. 54
      Assets/Scripts/Common/RoomWaiting/COMMANDCENTER_FIRENOTIFY_SYNC.cs

8
Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs

@ -28,7 +28,7 @@ public class UIFloor : BaseToggle
public GameObject HasChild;//显示该建筑(区域)下的所有楼层
public Transform MyTarget;
//private CameraManager cameraManager;
private float FollowCameraDistance = 250f;
private float FollowCameraDistance = 100f;
private CameraManager cameraManager;
private Transform P_AllParent;
private void Start()
@ -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<CloneGameObjInfo>();
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 ||

54
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<ChatPanel>().ShowPoliceSize();
//再再这里判断是不是有重复时间,有的话开携程等待
List<KeyValuePair<long, int>> zhiHArrivetimes = new List<KeyValuePair<long, int>>();
List<long> ZHID = new List<long>();
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<ChatPanel>().ShowPoliceSize();
}
}
IEnumerator waitinto(float time)
{
yield return new WaitForSeconds(time*0.2f);
transform.parent.Find("Police").gameObject.SetActive(true);
UIManager.GetView<ChatPanel>().ShowPoliceSize();
}
}

Loading…
Cancel
Save