diff --git a/Assets/Scenes/DongYouLiQing.unity b/Assets/Scenes/DongYouLiQing.unity index 8863fb3..c3baf90 100644 --- a/Assets/Scenes/DongYouLiQing.unity +++ b/Assets/Scenes/DongYouLiQing.unity @@ -1651,6 +1651,7 @@ GameObject: - component: {fileID: 5610} - component: {fileID: 5612} - component: {fileID: 5611} + - component: {fileID: 5613} m_Layer: 5 m_Name: Canvas m_TagString: Untagged @@ -1706,6 +1707,18 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 42e982fb8c0a7d74d95eaaabe91b085c, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &5613 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5608} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2206610ba23068244a480991e6309920, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &5617 stripped GameObject: m_CorrespondingSourceObject: {fileID: 1269886681434470, guid: f0560a995a5b6bc4fb5266e583acd3b9, diff --git a/Assets/Scripts/Common/CommandCenter/COMMANDCENTER_FIREMANNUM_SYNC.cs b/Assets/Scripts/Common/CommandCenter/COMMANDCENTER_FIREMANNUM_SYNC.cs index b30d096..d129af4 100644 --- a/Assets/Scripts/Common/CommandCenter/COMMANDCENTER_FIREMANNUM_SYNC.cs +++ b/Assets/Scripts/Common/CommandCenter/COMMANDCENTER_FIREMANNUM_SYNC.cs @@ -27,11 +27,14 @@ public class COMMANDCENTER_FIREMANNUM_SYNC : NetworkMessageBehaviour { GameSettings.othersSettings.DisplayName_Num_Dic[info.selectUserData.Org.DisplayName] += info.num; } - - - Debug.Log( GameSettings.othersSettings.DisplayName_Num_Dic[info.selectUserData.Org.DisplayName]); - - + if (!GameSettings.othersSettings.FireEngines_Dic.ContainsKey(info.selectUserData.Org.DisplayName)) + { + GameSettings.othersSettings.FireEngines_Dic.Add(info.selectUserData.Org.DisplayName, info.num); + } + else + { + GameSettings.othersSettings.FireEngines_Dic[info.selectUserData.Org.DisplayName] += info.num; + } } } public static void SetCar() diff --git a/Assets/Scripts/Common/Disasters/Wound_Trapped/HAEMAL_BLOOD_SYNC.cs b/Assets/Scripts/Common/Disasters/Wound_Trapped/HAEMAL_BLOOD_SYNC.cs index b189c6f..7256c51 100644 --- a/Assets/Scripts/Common/Disasters/Wound_Trapped/HAEMAL_BLOOD_SYNC.cs +++ b/Assets/Scripts/Common/Disasters/Wound_Trapped/HAEMAL_BLOOD_SYNC.cs @@ -39,9 +39,13 @@ public class HAEMAL_BLOOD_SYNC : NetworkMessageBehaviour GetComponent().pathFindEnable = false; GetComponent().SetDestination(transform.position); GetComponent().targetPosition = transform.position; - // GetComponent().enabled = false; + GetComponent().center = Vector3.zero; + GetComponent().radius = 0.7f; + GetComponent().height = 1f; + GetComponent().enabled = false; + // GetComponent().enabled = false; //GetComponent().center = new Vector3(0f, 0.2f, 0f); - // GetComponent().direction = 0; + // GetComponent().direction = 0; //if (GetComponent().enabled) //{ diff --git a/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs b/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs index ab3be3e..179f8df 100644 --- a/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs +++ b/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs @@ -145,6 +145,7 @@ public class TrappedMoveFree : MonoBehaviour CancelInvokeRandom(); GetComponent().StopAllCoroutines(); targetPosition = transform.position; + if(nav.enabled) nav.SetDestination(transform.position); GetComponent().pathFindEnable = false; if (GetComponent().Haemal > 50) @@ -721,10 +722,11 @@ public class TrappedMoveFree : MonoBehaviour targetPosition = transform.position; GetComponent().pathFindEnable = false; //设置碰撞器 - //GetComponent().center = new Vector3(0f, 0.2f, 0f); - //GetComponent().direction = 0; - //nav.enabled = false; - // transform.position = transform.position + Vector3.up; + GetComponent().center = Vector3.zero; + GetComponent().radius = 0.7f; + GetComponent().height = 1f; + nav.enabled = false; + } if (Guidance) { diff --git a/Assets/Scripts/Common/GameSettings/GameSettings.cs b/Assets/Scripts/Common/GameSettings/GameSettings.cs index 10581bc..8bf063e 100644 --- a/Assets/Scripts/Common/GameSettings/GameSettings.cs +++ b/Assets/Scripts/Common/GameSettings/GameSettings.cs @@ -44,8 +44,15 @@ public class OthersSettings public int personNum = 0; public int nowperson = 0; + /// + /// 中队派遣的消防员 + /// public Dictionary DisplayName_Num_Dic = new Dictionary(); /// + /// 力量调派的数据 + /// + public Dictionary FireEngines_Dic = new Dictionary(); + /// /// 中队是否到达 /// public Dictionary DisPlay_Arrive_Dic = new Dictionary(); @@ -136,6 +143,7 @@ public class OthersSettings DisplayName_Num_Dic = new Dictionary(); DisPlay_Arrive_Dic = new Dictionary(); DisCarList_Dic = new Dictionary>>(); + FireEngines_Dic = new Dictionary(); } } diff --git a/Assets/Scripts/Common/OperationalPreparation/EngineItem.cs b/Assets/Scripts/Common/OperationalPreparation/EngineItem.cs index 3e6dc5c..53f5ba7 100644 --- a/Assets/Scripts/Common/OperationalPreparation/EngineItem.cs +++ b/Assets/Scripts/Common/OperationalPreparation/EngineItem.cs @@ -54,18 +54,34 @@ public class EngineItem : MonoBehaviour { {//消防员 if (org == data.Value && tpyeCar.Key == null) { - //克隆一个,数量少一个,更改数据层;保证下一次打开作战部署窗口读取的数据正确 - if (FireEnginesData.Instance.GetAllPersons().ContainsKey(data.Value.DisplayName)) + if (GameSettings.othersSettings.mode == Mode.manoeuvre) { - FireEnginesData.Instance.GetAllPersons()[data.Value.DisplayName] = - FireEnginesData.Instance.GetAllPersons()[data.Value.DisplayName] - 1; + if (GameSettings.othersSettings.FireEngines_Dic.ContainsKey(data.Value.DisplayName)) + { + GameSettings.othersSettings.FireEngines_Dic[data.Value.DisplayName] = + GameSettings.othersSettings.FireEngines_Dic[data.Value.DisplayName] - 1; + } + //更新UI + if (FireEnginesData.Instance.GetAllPersons().ContainsKey(data.Value.DisplayName)) + { + transform.Find("Text").GetComponent().text = + "消防员" + "(" + GameSettings.othersSettings.FireEngines_Dic[data.Value.DisplayName] + ")"; + } } - - //更新UI - if (FireEnginesData.Instance.GetAllPersons().ContainsKey(data.Value.DisplayName)) + else { - transform.Find("Text").GetComponent().text = - "消防员" + "(" + FireEnginesData.Instance.GetAllPersons()[data.Value.DisplayName] + ")"; + //克隆一个,数量少一个,更改数据层;保证下一次打开作战部署窗口读取的数据正确 + if (FireEnginesData.Instance.GetAllPersons().ContainsKey(data.Value.DisplayName)) + { + FireEnginesData.Instance.GetAllPersons()[data.Value.DisplayName] = + FireEnginesData.Instance.GetAllPersons()[data.Value.DisplayName] - 1; + } + //更新UI + if (FireEnginesData.Instance.GetAllPersons().ContainsKey(data.Value.DisplayName)) + { + transform.Find("Text").GetComponent().text = + "消防员" + "(" + FireEnginesData.Instance.GetAllPersons()[data.Value.DisplayName] + ")"; + } } } } diff --git a/Assets/Scripts/Common/OperationalPreparation/FireEngines.cs b/Assets/Scripts/Common/OperationalPreparation/FireEngines.cs index 34312d3..466131c 100644 --- a/Assets/Scripts/Common/OperationalPreparation/FireEngines.cs +++ b/Assets/Scripts/Common/OperationalPreparation/FireEngines.cs @@ -133,7 +133,7 @@ public class FireEngines : MonoBehaviour { if (GameSettings.othersSettings.mode==Mode.manoeuvre) { engine.transform.Find("Text").GetComponent().text - = "消防员" + "(" + GameSettings.othersSettings.DisplayName_Num_Dic[orgList[i].DisplayName] + ")"; + = "消防员" + "(" + GameSettings.othersSettings.FireEngines_Dic[orgList[i].DisplayName] + ")"; } engine.transform.Find("Toggle/Background").GetComponent().color = colors[i]; engine.GetComponent().org = orgList[i]; diff --git a/Assets/Scripts/Common/OperationalPreparation/FireEnginesData.cs b/Assets/Scripts/Common/OperationalPreparation/FireEnginesData.cs index b8e1e72..5b878ee 100644 --- a/Assets/Scripts/Common/OperationalPreparation/FireEnginesData.cs +++ b/Assets/Scripts/Common/OperationalPreparation/FireEnginesData.cs @@ -11,7 +11,7 @@ public class FireEnginesData //每个中队的消防员人数 private Dictionary Persons = new Dictionary(); - + //按中队、车类型组织车辆数据(string:组织机构;List:某类型车有多少辆) private Dictionary>> DeptCars = new Dictionary>>(); @@ -87,9 +87,9 @@ public class FireEnginesData //演习模式下设置每个单位人数 if(GameSettings.othersSettings.mode==Mode.manoeuvre) { - foreach (var item in GameSettings.othersSettings.DisplayName_Num_Dic.Keys) + foreach (var item in GameSettings.othersSettings.FireEngines_Dic.Keys) { - Persons[orgName] = GameSettings.othersSettings.DisplayName_Num_Dic[orgName];//GetNum(item); + Persons[orgName] = GameSettings.othersSettings.FireEngines_Dic[item];//GetNum(item); } } @@ -145,6 +145,11 @@ public class FireEnginesData public Dictionary GetAllPersons() { + if (GameSettings.othersSettings.mode==Mode.manoeuvre) + { + return GameSettings.othersSettings.FireEngines_Dic; + } + else return Persons; } public void FireEnginesDataResert() diff --git a/Assets/Scripts/Common/ReportSystem/RECEIVER_COMMAND_SYNC.cs b/Assets/Scripts/Common/ReportSystem/RECEIVER_COMMAND_SYNC.cs index cd241af..c74b6c4 100644 --- a/Assets/Scripts/Common/ReportSystem/RECEIVER_COMMAND_SYNC.cs +++ b/Assets/Scripts/Common/ReportSystem/RECEIVER_COMMAND_SYNC.cs @@ -6,10 +6,41 @@ using UnityEngine; public class RECEIVER_COMMAND_SYNC : NetworkMessageBehaviour { + //public static List allreceive = new List(); protected override void Execute(BinaryMessage message) { ChatTaskMessage taskMsg = message.Body.Deserialize(); ReportDataMgr.AddReceiverCommand(taskMsg); - + //for (int i = 0; i < allreceive.Count; i++) + //{ + // if (allreceive[i].ID!=taskMsg.ID) + // { + // allreceive.Add(taskMsg); + // } + //} } + //public static int GetReceiveNum() + //{ + // int num = 0; + // if (CurrentUserInfo.role == Role.导调组 || CurrentUserInfo.role == Role.观察团) + // { + // num = allreceive.Count; + // } + // else + // { + // for (int i = 0; i < allreceive.Count; i++) + // { + // if (allreceive[i].ReceiverId==CurrentUserInfo.mySelf.Id) + // { + // num++; + // } + // } + // } + // return num; + //} + //protected override void OnDestroy() + //{ + // base.OnDestroy(); + // allreceive.Clear(); + //} } diff --git a/Assets/Scripts/Common/ReportSystem/ReportDataMgr.cs b/Assets/Scripts/Common/ReportSystem/ReportDataMgr.cs index 70d613e..351048f 100644 --- a/Assets/Scripts/Common/ReportSystem/ReportDataMgr.cs +++ b/Assets/Scripts/Common/ReportSystem/ReportDataMgr.cs @@ -329,7 +329,8 @@ public class ReportDataMgr // 获取所有命令数量 private static void GetAllCommandCount() { - + totalSendCommand = 0; + totalReceiverCommand = 0; // 如果时导调组观察团 if (CurrentUserInfo.role == Role.导调组 || CurrentUserInfo.role == Role.观察团) { diff --git a/Assets/Scripts/Common/ReportSystem/SEND_COMMAND_SYNC.cs b/Assets/Scripts/Common/ReportSystem/SEND_COMMAND_SYNC.cs index 75a56de..b021d2d 100644 --- a/Assets/Scripts/Common/ReportSystem/SEND_COMMAND_SYNC.cs +++ b/Assets/Scripts/Common/ReportSystem/SEND_COMMAND_SYNC.cs @@ -6,14 +6,71 @@ using UnityEngine; public class SEND_COMMAND_SYNC : NetworkMessageBehaviour { + public static List allsend = new List(); protected override void Execute(BinaryMessage message) { ChatTaskMessage taskMsg = message.Body.Deserialize(); ReportDataMgr.AddSendCommand(taskMsg); - + if (!ReportDataMgr.AllChatMessage.Contains(taskMsg)) { ReportDataMgr.AllChatMessage.Add(taskMsg); } + if (!allsend.Contains(taskMsg)) + { + allsend.Add(taskMsg); + } + } + /// + /// 获取自己发送的 + /// + /// + public static int GetSendMyself() + { + int num = 0; + for (int i = 0; i < allsend.Count; i++) + { + if (allsend[i].SenderId == CurrentUserInfo.mySelf.Id) + { + num++; + } + } + return num; + } + /// + /// 获取所有发送的 + /// + /// + public static int GetAllSend() + { + return allsend.Count; + } + /// + /// 获取自己接收的 + /// + /// + public static int GetReceiveMyself() + { + int receive = 0; + if (CurrentUserInfo.role == Role.导调组 || CurrentUserInfo.role == Role.观察团) + { + receive = allsend.Count; + } + else + { + for (int i = 0; i < allsend.Count; i++) + { + if (allsend[i].ReceiverId == CurrentUserInfo.mySelf.Id) + { + receive++; + } + } + } + return receive; + } + protected override void OnDestroy() + { + base.OnDestroy(); + allsend.Clear(); } } diff --git a/Assets/Scripts/Common/ReportSystem/UIViewReport.cs b/Assets/Scripts/Common/ReportSystem/UIViewReport.cs index e4ec1ba..782cb3b 100644 --- a/Assets/Scripts/Common/ReportSystem/UIViewReport.cs +++ b/Assets/Scripts/Common/ReportSystem/UIViewReport.cs @@ -54,7 +54,9 @@ public class UIViewReport : UIView UseWaterInfo.text = ReportDataMgr.GetAllUserWaterString(); //SendCommondInfo.text = ReportDataMgr.GetAllSendCommandString(); //ReceiverCommandInfo.text = ReportDataMgr.GetAllReceiverCommandString(); - SendCommondInfo.text = ReportDataMgr.GetSendMsgCount(); - ReceiverCommandInfo.text = ReportDataMgr.GetReceiveMsgCount(); + //SendCommondInfo.text = ReportDataMgr.GetSendMsgCount(); + //ReceiverCommandInfo.text = ReportDataMgr.GetReceiveMsgCount(); + SendCommondInfo.text = SEND_COMMAND_SYNC.GetSendMyself().ToString(); + ReceiverCommandInfo.text = SEND_COMMAND_SYNC.GetReceiveMyself().ToString(); } } diff --git a/Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/Associated/TruckBindWaterSource.cs b/Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/Associated/TruckBindWaterSource.cs index 76be6b9..39f226d 100644 --- a/Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/Associated/TruckBindWaterSource.cs +++ b/Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/Associated/TruckBindWaterSource.cs @@ -2294,7 +2294,16 @@ public class TruckBindWaterSource : MonoBehaviour WaterSource dirws1; if (WaterSourceLine1.Count > 0) { - dirws1 = EntitiesManager.Instance.GetEntityByID(WaterSourceLine1[0][0]).GetComponent(); + if (EntitiesManager.Instance.GetEntityByID(WaterSourceLine1[0][0]) && + EntitiesManager.Instance.GetEntityByID(WaterSourceLine1[0][0]).GetComponent()) + { + dirws1 = EntitiesManager.Instance.GetEntityByID(WaterSourceLine1[0][0]).GetComponent(); + } + else + { + dirws1 = null; + } + } else {