Browse Source

1、轻伤员倒地编重伤员时修改角色碰撞器大小方便选中

2、修改上下级命令统计条数不准确问题
3、修改作战部署克隆消防员后数量不对问题
develop
曹衍涛 4 years ago
parent
commit
aa3fe7a6f0
  1. 13
      Assets/Scenes/DongYouLiQing.unity
  2. 13
      Assets/Scripts/Common/CommandCenter/COMMANDCENTER_FIREMANNUM_SYNC.cs
  3. 8
      Assets/Scripts/Common/Disasters/Wound_Trapped/HAEMAL_BLOOD_SYNC.cs
  4. 10
      Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs
  5. 8
      Assets/Scripts/Common/GameSettings/GameSettings.cs
  6. 34
      Assets/Scripts/Common/OperationalPreparation/EngineItem.cs
  7. 2
      Assets/Scripts/Common/OperationalPreparation/FireEngines.cs
  8. 11
      Assets/Scripts/Common/OperationalPreparation/FireEnginesData.cs
  9. 33
      Assets/Scripts/Common/ReportSystem/RECEIVER_COMMAND_SYNC.cs
  10. 3
      Assets/Scripts/Common/ReportSystem/ReportDataMgr.cs
  11. 59
      Assets/Scripts/Common/ReportSystem/SEND_COMMAND_SYNC.cs
  12. 6
      Assets/Scripts/Common/ReportSystem/UIViewReport.cs
  13. 11
      Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/Associated/TruckBindWaterSource.cs

13
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,

13
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()

8
Assets/Scripts/Common/Disasters/Wound_Trapped/HAEMAL_BLOOD_SYNC.cs

@ -39,9 +39,13 @@ public class HAEMAL_BLOOD_SYNC : NetworkMessageBehaviour
GetComponent<TrappedPathFind>().pathFindEnable = false;
GetComponent<NavMeshAgent>().SetDestination(transform.position);
GetComponent<TrappedMoveFree>().targetPosition = transform.position;
// GetComponent<NavMeshAgent>().enabled = false;
GetComponent<CharacterController>().center = Vector3.zero;
GetComponent<CharacterController>().radius = 0.7f;
GetComponent<CharacterController>().height = 1f;
GetComponent<NavMeshAgent>().enabled = false;
// GetComponent<NavMeshAgent>().enabled = false;
//GetComponent<CapsuleCollider>().center = new Vector3(0f, 0.2f, 0f);
// GetComponent<CapsuleCollider>().direction = 0;
// GetComponent<CapsuleCollider>().direction = 0;
//if (GetComponent<CapsuleCollider>().enabled)
//{

10
Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs

@ -145,6 +145,7 @@ public class TrappedMoveFree : MonoBehaviour
CancelInvokeRandom();
GetComponent<TrappedPathFind>().StopAllCoroutines();
targetPosition = transform.position;
if(nav.enabled)
nav.SetDestination(transform.position);
GetComponent<TrappedPathFind>().pathFindEnable = false;
if (GetComponent<BaseHaemalController>().Haemal > 50)
@ -721,10 +722,11 @@ public class TrappedMoveFree : MonoBehaviour
targetPosition = transform.position;
GetComponent<TrappedPathFind>().pathFindEnable = false;
//设置碰撞器
//GetComponent<CapsuleCollider>().center = new Vector3(0f, 0.2f, 0f);
//GetComponent<CapsuleCollider>().direction = 0;
//nav.enabled = false;
// transform.position = transform.position + Vector3.up;
GetComponent<CharacterController>().center = Vector3.zero;
GetComponent<CharacterController>().radius = 0.7f;
GetComponent<CharacterController>().height = 1f;
nav.enabled = false;
}
if (Guidance)
{

8
Assets/Scripts/Common/GameSettings/GameSettings.cs

@ -44,8 +44,15 @@ public class OthersSettings
public int personNum = 0;
public int nowperson = 0;
/// <summary>
/// 中队派遣的消防员
/// </summary>
public Dictionary<string, int> DisplayName_Num_Dic = new Dictionary<string, int>();
/// <summary>
/// 力量调派的数据
/// </summary>
public Dictionary<string, int> FireEngines_Dic = new Dictionary<string, int>();
/// <summary>
/// 中队是否到达
/// </summary>
public Dictionary<string, bool> DisPlay_Arrive_Dic = new Dictionary<string, bool>();
@ -136,6 +143,7 @@ public class OthersSettings
DisplayName_Num_Dic = new Dictionary<string, int>();
DisPlay_Arrive_Dic = new Dictionary<string, bool>();
DisCarList_Dic = new Dictionary<string, List<KeyValuePair<FireCarEngine, bool>>>();
FireEngines_Dic = new Dictionary<string, int>();
}
}

34
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>().text =
"消防员" + "(" + GameSettings.othersSettings.FireEngines_Dic[data.Value.DisplayName] + ")";
}
}
//更新UI
if (FireEnginesData.Instance.GetAllPersons().ContainsKey(data.Value.DisplayName))
else
{
transform.Find("Text").GetComponent<Text>().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>().text =
"消防员" + "(" + FireEnginesData.Instance.GetAllPersons()[data.Value.DisplayName] + ")";
}
}
}
}

2
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>().text
= "消防员" + "(" + GameSettings.othersSettings.DisplayName_Num_Dic[orgList[i].DisplayName] + ")";
= "消防员" + "(" + GameSettings.othersSettings.FireEngines_Dic[orgList[i].DisplayName] + ")";
}
engine.transform.Find("Toggle/Background").GetComponent<Image>().color = colors[i];
engine.GetComponent<EngineItem>().org = orgList[i];

11
Assets/Scripts/Common/OperationalPreparation/FireEnginesData.cs

@ -11,7 +11,7 @@ public class FireEnginesData
//每个中队的消防员人数
private Dictionary<string, int> Persons = new Dictionary<string, int>();
//按中队、车类型组织车辆数据(string:组织机构;List<KeyValuePair<FireCarEngine, int>:某类型车有多少辆)
private Dictionary<string, List<KeyValuePair<FireCarEngine, int>>> DeptCars =
new Dictionary<string, List<KeyValuePair<FireCarEngine, int>>>();
@ -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<string, int> GetAllPersons()
{
if (GameSettings.othersSettings.mode==Mode.manoeuvre)
{
return GameSettings.othersSettings.FireEngines_Dic;
}
else
return Persons;
}
public void FireEnginesDataResert()

33
Assets/Scripts/Common/ReportSystem/RECEIVER_COMMAND_SYNC.cs

@ -6,10 +6,41 @@ using UnityEngine;
public class RECEIVER_COMMAND_SYNC : NetworkMessageBehaviour
{
//public static List<ChatTaskMessage> allreceive = new List<ChatTaskMessage>();
protected override void Execute(BinaryMessage message)
{
ChatTaskMessage taskMsg = message.Body.Deserialize<ChatTaskMessage>();
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();
//}
}

3
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.)
{

59
Assets/Scripts/Common/ReportSystem/SEND_COMMAND_SYNC.cs

@ -6,14 +6,71 @@ using UnityEngine;
public class SEND_COMMAND_SYNC : NetworkMessageBehaviour
{
public static List<ChatTaskMessage> allsend = new List<ChatTaskMessage>();
protected override void Execute(BinaryMessage message)
{
ChatTaskMessage taskMsg = message.Body.Deserialize<ChatTaskMessage>();
ReportDataMgr.AddSendCommand(taskMsg);
if (!ReportDataMgr.AllChatMessage.Contains(taskMsg))
{
ReportDataMgr.AllChatMessage.Add(taskMsg);
}
if (!allsend.Contains(taskMsg))
{
allsend.Add(taskMsg);
}
}
/// <summary>
/// 获取自己发送的
/// </summary>
/// <returns></returns>
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;
}
/// <summary>
/// 获取所有发送的
/// </summary>
/// <returns></returns>
public static int GetAllSend()
{
return allsend.Count;
}
/// <summary>
/// 获取自己接收的
/// </summary>
/// <returns></returns>
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();
}
}

6
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();
}
}

11
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<WaterSource>();
if (EntitiesManager.Instance.GetEntityByID(WaterSourceLine1[0][0]) &&
EntitiesManager.Instance.GetEntityByID(WaterSourceLine1[0][0]).GetComponent<WaterSource>())
{
dirws1 = EntitiesManager.Instance.GetEntityByID(WaterSourceLine1[0][0]).GetComponent<WaterSource>();
}
else
{
dirws1 = null;
}
}
else
{

Loading…
Cancel
Save