using System; using System.Collections; using System.Collections.Generic; using AX.Network.Protocols; using UnityEngine; using AX.Serialization; using UnityEngine.SceneManagement; using AX.NetworkSystem; public class COMMANDCENTER_FIRENOTIFY_SYNC : NetworkMessageBehaviour { protected override void Execute(BinaryMessage message) { var info = message.Body.Deserialize(); if (CurrentUserInfo.role == Role.总队指挥 || CurrentUserInfo.role == Role.大队指挥 || CurrentUserInfo.role == Role.支队指挥 ) { GameSettings.disasterSetting.policeCallData = info; foreach (UserData u in CurrentUserInfo.room.UserList) { if (u.Org.Id == CurrentUserInfo.organization.Id && u.Role == Role.参谋) // 参谋随着对应总队、支队、大队跳转场景 { //将通报指令转发给参谋同时添加参谋到场时间 int time = 0; foreach (var item in info.ArriveTimeList) { if (item.Key == CurrentUserInfo.mySelf.Id) { time = item.Value; } } info.ArriveTimeList.Add(new KeyValuePair(u.UserInfo.Id, time)); NetworkManager.Default.SendAsync("COMMANDCENTER_FIRENOTIFY_SYNC", new KeyValuePair (u.UserInfo.Id, info)); } } //SceneManager.LoadScene("Police"); transform.parent.Find("Police").gameObject.SetActive(true); UIManager.GetView().ShowPoliceSize(); } //else if (CurrentUserInfo.role == Role.中队指挥) //{ // GameSettings.disasterSetting.policeCallData = info; // foreach (UserData u in CurrentUserInfo.room.UserList) // { // if (u.Org.Id == CurrentUserInfo.organization.Id && u.Role == Role.战斗班长) // // 参谋随着对应战斗班跳转场景 // { // //将通报指令转发给战斗班 // NetworkManager.Default.SendAsync("COMMANDCENTER_FIRENOTIFY_SYNC", new KeyValuePair // (u.UserInfo.Id, info)); // } // } // SceneManager.LoadScene("Police"); //} else { GameSettings.disasterSetting.policeCallData = info; // SceneManager.LoadScene("Police"); transform.parent.Find("Police").gameObject.SetActive(true); UIManager.GetView().ShowPoliceSize(); } } }