Browse Source

同步高层修改

develop
曹衍涛 4 years ago
parent
commit
9ec082037c
  1. 11
      Assets/ExitBack.cs
  2. 2
      Assets/Resources/ClonePrefabs/DisasterPrefabs/TrappedPerson.prefab
  3. 13
      Assets/Resources/ClonePrefabs/Tool/FirefightingRobot.prefab
  4. 49476
      Assets/Resources/ClonePrefabs/Tool/SnowCannon.prefab
  5. 2
      Assets/Scenes/DummyScene.unity
  6. 46
      Assets/Scripts/Common/ChatSystem/ChatManager.cs
  7. 35
      Assets/Scripts/Common/ChatSystem/FireSiteInfo/OnwayForce/OnwayForceTotal.cs
  8. 13
      Assets/Scripts/Common/ChatSystem/FireSiteInfo/RescueInfo/TrappedInfo.cs
  9. 9
      Assets/Scripts/Common/ChatSystem/FireSiteInfo/RescueInfo/WoundedInfo.cs
  10. 9
      Assets/Scripts/Common/ChatSystem/PrivateChat/PrivateChatToggle.cs
  11. 6
      Assets/Scripts/Common/Clone/CloneObjNameTool.cs
  12. 28
      Assets/Scripts/Common/Disasters/Wound_Trapped/TRAPPED_GUIDANCE_SYNC.cs
  13. 82
      Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs
  14. 131
      Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedPathFind.cs
  15. 58
      Assets/Scripts/Common/HelpClasses/WaterSource.cs
  16. 25
      Assets/Scripts/Common/Police/CommandingCtrl.cs
  17. 26
      Assets/Scripts/Common/Police/PoliceInfoMsgBind.cs
  18. 166
      Assets/Scripts/Common/ReportSystem/ReportDataMgr.cs
  19. 6
      Assets/Scripts/Common/User/CurrentUserInfo.cs
  20. 15
      Assets/Scripts/DongYouLiQing/BaseCommander/FireRobotLayWaterHose.cs
  21. 28
      Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/Associated/ASSOCIATED_LINE_SYNC.cs
  22. 46
      Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/Associated/TruckBindWaterSource.cs
  23. 24
      Assets/Scripts/DongYouLiQing/BaseCommander/HandOver/HandOverToggle.cs
  24. 26
      Assets/Scripts/DongYouLiQing/BaseCommander/HandOver/ZDBHandOverToggle.cs
  25. 35
      Assets/Scripts/DongYouLiQing/LeadGroup/FireInfoListToggle.cs

11
Assets/ExitBack.cs

@ -7,6 +7,7 @@ public class ExitBack : MonoBehaviour
// Start is called before the first frame update
void Start()
{
//力量部署信息重置
FireEnginesData.Instance.FireEnginesDataResert();
EntitiesManager.Instance.Reset();//跳转场景时要清空实体管理器中的对象
//UIManager.ResertUIManager();
@ -23,11 +24,19 @@ public class ExitBack : MonoBehaviour
//重置到场力量
ArrivedPowerTotal.ResertArrivePowerTotal();
DisasterLibraryFile.Instance.Reset();
//清空内置判断错误列表
REPORT_ERROR_SYNC.ErrorList.Clear();
ChatManager.Instance.ResertChatManager();
GET_INSIDER_ANSWER_SYNC.feedback.Clear();
ArrivedPowerTotal.arrivedCars.Clear();
OnwayForceTotal.ResertOnway();
CurrentUserInfo.ResertExit();
CloneObjNameTool.Instance().ResertCloneObjNameTool();
}
// Update is called once per frame
void Update()
{
}
}

2
Assets/Resources/ClonePrefabs/DisasterPrefabs/TrappedPerson.prefab

@ -1254,7 +1254,7 @@ CharacterController:
m_Enabled: 1
serializedVersion: 2
m_Height: 2
m_Radius: 0.5
m_Radius: 0.3
m_SlopeLimit: 45
m_StepOffset: 0.3
m_SkinWidth: 0.08

13
Assets/Resources/ClonePrefabs/Tool/FirefightingRobot.prefab

@ -9123,6 +9123,7 @@ GameObject:
- component: {fileID: 114365251465385902}
- component: {fileID: 114393244420263936}
- component: {fileID: 6006252576172989200}
- component: {fileID: 7800341909387911175}
m_Layer: 0
m_Name: FirefightingRobot
m_TagString: Untagged
@ -9434,6 +9435,18 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0a2ae739074b1f74a839051cde37ee81, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &7800341909387911175
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1101292219423796}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8f43dda07f7d78848914e03dc8aae720, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1137826126722962
GameObject:
m_ObjectHideFlags: 0

49476
Assets/Resources/ClonePrefabs/Tool/SnowCannon.prefab

File diff suppressed because it is too large Load Diff

2
Assets/Scenes/DummyScene.unity

@ -171,7 +171,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!114 &546100756
MonoBehaviour:
m_ObjectHideFlags: 0

46
Assets/Scripts/Common/ChatSystem/ChatManager.cs

@ -260,14 +260,14 @@ public class ChatManager : Singleton<ChatManager>
return tempData;
}
public List<long> FindDirectionSubUserDataID()
public List<long> FindDirectionSubUserDataID()
{
//查找要显示的上级用户数据
List<long> usersDatalist = new List<long>();
//练习模式组织机构可以变化
DirectionSubsId.Clear();
FindDirectionSupId(CurrentUserInfo.organization.ParentId);
foreach (var item in CurrentUserInfo.room.UserList)
{
if (item.UserInfo.Id != CurrentUserInfo.mySelf.Id)
@ -291,29 +291,29 @@ public class ChatManager : Singleton<ChatManager>
}
return usersDatalist;
}
public long FindDirectionSupUserDataID()
public long FindDirectionSupUserDataID()
{
//查找要显示的上级用户数据
long tempData = 0;
//练习模式组织机构可以变化
DirectionSupId = 0;
FindDirectionSupId(CurrentUserInfo.organization.ParentId);
foreach (var item in CurrentUserInfo.room.UserList)
{
if (item.UserInfo.Id != CurrentUserInfo.mySelf.Id)
{
// 数据中不存在战斗班的数据
if (item.Org.Id.Equals(DirectionSupId)
&& item.Org.Level != 5
&& item.Role != Role.
&& item.Role != Role.
&& item.Role != Role.
&& item.Role != Role.)
{
tempData = item.UserInfo.Id;
break;
}
// 数据中不存在战斗班的数据
if (item.Org.Id.Equals(DirectionSupId)
&& item.Org.Level != 5
&& item.Role != Role.
&& item.Role != Role.
&& item.Role != Role.
&& item.Role != Role.)
{
tempData = item.UserInfo.Id;
break;
}
}
}
return tempData;
@ -349,7 +349,7 @@ public class ChatManager : Singleton<ChatManager>
}
}
}
public void FindDirectionSupId(int supId)
public void FindDirectionSupId(int supId)
{
foreach (var item in orgs)
{
@ -361,7 +361,7 @@ public class ChatManager : Singleton<ChatManager>
}
}
}
public void FindDirectionSubId(int id)
public void FindDirectionSubId(int id)
{
foreach (var item in orgs)
{
@ -389,7 +389,7 @@ public class ChatManager : Singleton<ChatManager>
}
}
}
/// <summary>
/// 创建一个2人的房间
/// </summary>
@ -512,7 +512,7 @@ public class ChatManager : Singleton<ChatManager>
textMsg.ChatGroup = ChatType.PrivateChat;
NetworkManager.Default.SendAsync("PRIVATE_TEXT_MESSAGE_SYNC", textMsg);
}
public void SendPrivateChatTaskMsg(string taskContent, ChatChannel channel,UserData userdata)
public void SendPrivateChatTaskMsg(string taskContent, ChatChannel channel, UserData userdata)
{
ChatTaskMessage msg = new ChatTaskMessage();
msg.SenderId = CurrentUserInfo.mySelf.Id;
@ -925,5 +925,13 @@ public class ChatManager : Singleton<ChatManager>
}
#endregion
#endregion
public void ResertChatManager()
{
Msgs.Clear();
UnReadMsgs.Clear();
PublicChatMsgs.Clear();
//TaskData.Clear();
SuggestChatMsg.Clear();
}
}

35
Assets/Scripts/Common/ChatSystem/FireSiteInfo/OnwayForce/OnwayForceTotal.cs

@ -8,13 +8,14 @@ using UnityEngine;
using UnityEngine.UI;
public class OnwayForceTotal : MonoBehaviour {
public class OnwayForceTotal : MonoBehaviour
{
private static Dictionary<string, List<KeyValuePair<FireCarEngine, int>>> onwayCars = new Dictionary<string, List<KeyValuePair<FireCarEngine, int>>>();
//public static event Func<Dictionary<string, List<KeyValuePair<FireCarEngine, int>>>, Dictionary<string, List<KeyValuePair<FireCarEngine, int>>>> getOnwayCars;
private int teams = 0;
private int trucks = 0;
private int firemen = 0;
public GameObject content;
public GameObject content;
private void OnEnable()
{
@ -26,21 +27,21 @@ public class OnwayForceTotal : MonoBehaviour {
teams = onwayCars.Count;
trucks = 0;
firemen = 0;
foreach(string team in onwayCars.Keys)
foreach (string team in onwayCars.Keys)
{
foreach(KeyValuePair<FireCarEngine,int> pair in onwayCars[team])
foreach (KeyValuePair<FireCarEngine, int> pair in onwayCars[team])
{
trucks += pair.Value;
firemen += (int)pair.Key.PassengerCapacity * pair.Value;
}
}
}
GetComponent<Text>().text = "在途力量共" + teams + "个中队," + trucks + "辆车," + firemen + "名消防员";
if (content == null)
{
content = transform.parent.Find("Scroll View/Viewport/Content").gameObject;
content = transform.parent.Find("Scroll View/Viewport/Content").gameObject;
}
content.GetComponent<OnwayContent>().CreateItems(onwayCars);
}
}
/// <summary>
/// 有新车辆调派
/// </summary>
@ -49,7 +50,7 @@ public class OnwayForceTotal : MonoBehaviour {
{
List<KeyValuePair<FireCarEngine, int>> cars = new List<KeyValuePair<FireCarEngine, int>>();
//之前已经有这个中队,将该中队已有的在途车辆提取出到typeCars
if (onwayCars.TryGetValue(carPair.Key,out cars))
if (onwayCars.TryGetValue(carPair.Key, out cars))
{
foreach (KeyValuePair<FireCarEngine, int> item in carPair.Value)
{
@ -60,7 +61,7 @@ public class OnwayForceTotal : MonoBehaviour {
//之前没有这个中队
else
{
onwayCars.Add(carPair.Key,carPair.Value);
onwayCars.Add(carPair.Key, carPair.Value);
}
UserData userData = CurrentUserInfo.room.FindMidTeamUserIDByName(carPair.Key);
NetworkManager.Default.SendRequestAsync("ARRIVAL_TIME_REQUEST", new ArrivalTimePair() { sender = CurrentUserInfo.mySelf.Id, receiver = userData.UserInfo.Id, time = "", arrived = false });
@ -68,7 +69,7 @@ public class OnwayForceTotal : MonoBehaviour {
private static void AddCar(List<KeyValuePair<FireCarEngine, int>> typeCars, KeyValuePair<FireCarEngine, int> item)
{
//如果之前保存过这种车型
for(int i = 0; i < typeCars.Count; i++)
for (int i = 0; i < typeCars.Count; i++)
{
if (typeCars[i].Key.TypeName == item.Key.TypeName)
{
@ -84,10 +85,10 @@ public class OnwayForceTotal : MonoBehaviour {
/// </summary>
/// <param name="team"></param>
/// <param name="fireCarEngine"></param>
public static void RemoveArrivedCar(string team,FireCarEngine fireCarEngine)
public static void RemoveArrivedCar(string team, FireCarEngine fireCarEngine)
{
List<KeyValuePair<FireCarEngine, int>> list = new List<KeyValuePair<FireCarEngine, int>>();
if(onwayCars.TryGetValue(team,out list))
if (onwayCars.TryGetValue(team, out list))
{
for (int i = 0; i < list.Count; i++)
{
@ -105,7 +106,7 @@ public class OnwayForceTotal : MonoBehaviour {
return;
}
}
}
}
}
/// <summary>
/// 从在途力量中删除到达中队车辆
@ -114,11 +115,11 @@ public class OnwayForceTotal : MonoBehaviour {
public static void RemoveArrivedCar(string team)
{
List<KeyValuePair<FireCarEngine, int>> list = new List<KeyValuePair<FireCarEngine, int>>();
if(onwayCars.TryGetValue(team,out list))
if (onwayCars.TryGetValue(team, out list))
{
//深拷贝
List<KeyValuePair<FireCarEngine, int>> listCopy = new List<KeyValuePair<FireCarEngine, int>>();
for(int i = 0; i < list.Count; i++)
for (int i = 0; i < list.Count; i++)
{
KeyValuePair<FireCarEngine, int> pair = new KeyValuePair<FireCarEngine, int>(list[i].Key, list[i].Value);
listCopy.Add(pair);
@ -127,4 +128,8 @@ public class OnwayForceTotal : MonoBehaviour {
onwayCars.Remove(team);
}
}
public static void ResertOnway()
{
onwayCars.Clear();
}
}

13
Assets/Scripts/Common/ChatSystem/FireSiteInfo/RescueInfo/TrappedInfo.cs

@ -5,20 +5,25 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TrappedInfo : MonoBehaviour {
public class TrappedInfo : MonoBehaviour
{
public Text trappedAll;
public Text trappedRescued;
public Text trappedUnrescued;
public static event Func<IntData, IntData> getAllTrappedCount;
public static event Func<IntData, IntData> getTrappedRescuedCount;
void Awake()
{
trappedAll = transform.Find("TrappedAll").GetComponent<Text>();
trappedRescued = transform.Find("TrappedRescued").GetComponent<Text>();
trappedUnrescued = transform.Find("TrappedUnrescued").GetComponent<Text>();
MessageDispatcher.AddListener("SomeoneOutOfTrap", UpdateInfoListener); //开启窗口时,每当有人被营救,更新显示信息
}
}
private void OnDestroy()
{
MessageDispatcher.RemoveListener("SomeoneOutOfTrap", UpdateInfoListener); //开启窗口时,每当有人被营救,更新显示信息
}
void UpdateInfoListener(IMessage obj)
{
UpdateInfo();
@ -45,5 +50,5 @@ public class TrappedInfo : MonoBehaviour {
void OnEnable()
{
UpdateInfo();
}
}
}

9
Assets/Scripts/Common/ChatSystem/FireSiteInfo/RescueInfo/WoundedInfo.cs

@ -5,7 +5,8 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class WoundedInfo : MonoBehaviour {
public class WoundedInfo : MonoBehaviour
{
public Text woundedAll;
public Text woundedRescued;
public Text woundedUnrescued;
@ -19,6 +20,10 @@ public class WoundedInfo : MonoBehaviour {
woundedUnrescued = transform.Find("WoundedUnrescued").GetComponent<Text>();
MessageDispatcher.AddListener("SomeoneOutOfTrap", UpdateInfoListener); //开启窗口时,每当有人被营救,更新显示信息
}
private void OnDestroy()
{
MessageDispatcher.RemoveListener("SomeoneOutOfTrap", UpdateInfoListener); //开启窗口时,每当有人被营救,更新显示信息
}
private void OnEnable()
{
UpdateInfo();
@ -42,7 +47,7 @@ public class WoundedInfo : MonoBehaviour {
dataRescued = getWoundedRescuedCount(dataRescued);
}
woundedRescued.text = dataRescued.value.ToString();
woundedUnrescued.text = (dataAll.value - dataRescued.value).ToString();
}
}

9
Assets/Scripts/Common/ChatSystem/PrivateChat/PrivateChatToggle.cs

@ -21,7 +21,10 @@ public class PrivateChatToggle : BaseToggle
MessageDispatcher.AddListener("REFRESH_UNREAD_MSG", GetUnReadMsg);
UnReadObj.SetActive(false);
}
public override void OnDestroy()
{
MessageDispatcher.RemoveListener("REFRESH_UNREAD_MSG", GetUnReadMsg);
}
private void GetUnReadMsg(IMessage msg)
{
// 查找所有下级或上级频道
@ -69,12 +72,12 @@ public class PrivateChatToggle : BaseToggle
}
//UIView-OnShow
UIManager.GetView<PrivateChatPanel>(Type.ToString())
.OnShow = (v) =>
.OnShow = (v) =>
(v as PrivateChatPanel).UsersInfo = users;
//UIView-OnHide
UIManager.GetView<PrivateChatPanel>(Type.ToString())
.OnHide = (v) =>
.OnHide = (v) =>
GetComponent<Toggle>().isOn = false;
//显示页面

6
Assets/Scripts/Common/Clone/CloneObjNameTool.cs

@ -72,10 +72,14 @@ public class CloneObjNameTool
{
deptName = "灾情";
}
var cloneObjTypeName = cloneObjType.ToString();
var number = GetCloneObjectNumber(deptName, cloneObjType);
name = deptName + "-" + cloneObjTypeName + "-" + number;
return name;
}
public void ResertCloneObjNameTool()
{
cloneObjectNumber.Clear();
}
}

28
Assets/Scripts/Common/Disasters/Wound_Trapped/TRAPPED_GUIDANCE_SYNC.cs

@ -51,26 +51,38 @@ public class TRAPPED_GUIDANCE_SYNC : NetworkMessageBehaviour
trapped.IsSetPoint = false;
trapped.guidPoint = info.Guidlist;
trapped.IsselfClient = false;
TrappedPathFindingCmdArgs arg = new TrappedPathFindingCmdArgs();
arg.hitPoint = info.Guidlist[0];
GetComponent<TrappedMoveFree>().targetPosition = arg.hitPoint;
//arg.gameObjID = GetComponent<BaseGameObjInfo>().gameObjID;
arg.gameObjIdSelf = GetComponent<BaseGameObjInfo>().gameObjID;
TrappedPathFindingCommand.Instance.Execute(GetComponent<BaseGameObjInfo>().gameObjID, arg);
if (CurrentUserInfo.room != null && CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
{
TrappedPathFindingCmdArgs arg = new TrappedPathFindingCmdArgs();
arg.hitPoint = info.Guidlist[0];
GetComponent<TrappedMoveFree>().targetPosition = arg.hitPoint;
//arg.gameObjID = GetComponent<BaseGameObjInfo>().gameObjID;
arg.gameObjIdSelf = GetComponent<BaseGameObjInfo>().gameObjID;
TrappedPathFindingCommand.Instance.Execute(GetComponent<BaseGameObjInfo>().gameObjID, arg);
}
Transform SafeArea = GameObject.Find("P_AllParent/P_Tools/P_SafeArea").transform.GetChild(0);
if (SafeArea)
{
GetComponent<CloneGameObjInfo>().buildNum = SafeArea.GetComponent<CloneGameObjInfo>().buildNum;
GetComponent<CloneGameObjInfo>().interlayerNum = SafeArea.GetComponent<CloneGameObjInfo>().interlayerNum;
GetComponent<CloneGameObjInfo>().floorNum = SafeArea.GetComponent<CloneGameObjInfo>().floorNum;
}
}
else
{
trapped.Guidance = false;
trapped.movestate = MoveState.IDLE;
GetComponent<TrappedPathFind>().StopAllCoroutines();
trapped.StopAllCoroutines();
//GetComponent<NavMeshAgent>().enabled = false;
trapped.OverMoveOrGuidance = true;
//MessageDispatcher.SendMessage("SomeoneOutOfTrap"); //通知火场信息-疏散救生-被困时间部分更新,看是否可以停止计时
TrappedTime.CheckStopTime();
// GetComponent<Animator>().SetFloat("Speed", 0);
// GetComponent<Animator>().SetFloat("Speed", 0);
}
}
}
}
}

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

@ -248,7 +248,7 @@ public class TrappedMoveFree : MonoBehaviour
GameObject fireMan = EntitiesManager.Instance.GetEntityByID(info.fireManID);
if (info.gameObjID == GetComponent<BaseGameObjInfo>().gameObjID)
{
if(Haemal<=0)
if (Haemal <= 0)
{
LoadPromptWin.Instance.LoadTextPromptWindow("该人员已死亡,不能操作", 2f);
return;
@ -464,6 +464,9 @@ public class TrappedMoveFree : MonoBehaviour
MoveFireman = fireMan;
targetPosition = Vector3.zero;
GetComponent<TrappedPathFind>().StopAllCoroutines();
GetComponent<NavMeshAgent>().SetDestination(transform.position);
movestate = MoveState.IDLE;
//被困人员移动同步
TrappedMoveFollowFiremanSyncData arg = new TrappedMoveFollowFiremanSyncData();
@ -566,7 +569,7 @@ public class TrappedMoveFree : MonoBehaviour
}
}
}
targetPosition = guidPoint[0];
SaveFrirmanUserId = fireman.GetComponent<BaseGameObjInfo>().UserID;
//引导同步
TrappedGuidanceSyncData argguide = new TrappedGuidanceSyncData();
@ -577,13 +580,17 @@ public class TrappedMoveFree : MonoBehaviour
argguide.gameObjID = GetComponent<BaseGameObjInfo>().gameObjID;
NetworkManager.Default.SendAsync("TRAPPED_GUIDANCE_SYNC", argguide);
TrappedPathFindingCmdArgs arg = new TrappedPathFindingCmdArgs();
arg.hitPoint = guidPoint[0];
targetPosition = arg.hitPoint;
//arg.gameObjID = GetComponent<BaseGameObjInfo>().gameObjID;
arg.gameObjIdSelf = GetComponent<BaseGameObjInfo>().gameObjID;
TrappedPathFindingCommand.Instance.Execute(GetComponent<BaseGameObjInfo>().gameObjID, arg);
//TrappedPathFindingCmdArgs arg = new TrappedPathFindingCmdArgs();
//arg.hitPoint = guidPoint[0];
//targetPosition = arg.hitPoint;
////arg.gameObjID = GetComponent<BaseGameObjInfo>().gameObjID;
//arg.gameObjIdSelf = GetComponent<BaseGameObjInfo>().gameObjID;
//TrappedPathFindingCommand.Instance.Execute(GetComponent<BaseGameObjInfo>().gameObjID, arg);
CloneGameObjInfo msg = GetComponent<CloneGameObjInfo>();
Transform safe = P_SafeArea.transform.GetChild(0);
msg.buildNum = safe.GetComponent<CloneGameObjInfo>().buildNum;
msg.floorNum = safe.GetComponent<CloneGameObjInfo>().floorNum;
msg.interlayerNum = safe.GetComponent<CloneGameObjInfo>().interlayerNum;
}
@ -601,12 +608,15 @@ public class TrappedMoveFree : MonoBehaviour
//}
//GuidIndex++;
guidPoint.Remove(guidPoint[0]);
TrappedPathFindingCmdArgs arg = new TrappedPathFindingCmdArgs();
arg.hitPoint = guidPoint[0];
targetPosition = guidPoint[0];
arg.gameObjIdSelf = GetComponent<BaseGameObjInfo>().gameObjID;
TrappedPathFindingCommand.Instance.Execute(GetComponent<BaseGameObjInfo>().gameObjID, arg);
if (CurrentUserInfo.room != null && CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
{
TrappedPathFindingCmdArgs arg = new TrappedPathFindingCmdArgs();
arg.hitPoint = guidPoint[0];
targetPosition = guidPoint[0];
arg.gameObjIdSelf = GetComponent<BaseGameObjInfo>().gameObjID;
TrappedPathFindingCommand.Instance.Execute(GetComponent<BaseGameObjInfo>().gameObjID, arg);
}
}
void Start()
@ -635,12 +645,16 @@ public class TrappedMoveFree : MonoBehaviour
dangerousDetection();
if (MeetDangerous)
{
Vector3 dia = transform.position - DangerousLastmet;
targetPosition = dia;
TrappedPathFindingCmdArgs arg = new TrappedPathFindingCmdArgs();
arg.hitPoint = transform.position + dia;
arg.gameObjIdSelf = GetComponent<BaseGameObjInfo>().gameObjID;
TrappedPathFindingCommand.Instance.Execute(GetComponent<BaseGameObjInfo>().gameObjID, arg);
if (CurrentUserInfo.room != null && CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
{
Vector3 dia = transform.position - DangerousLastmet;
targetPosition = dia;
TrappedPathFindingCmdArgs arg = new TrappedPathFindingCmdArgs();
arg.hitPoint = transform.position + dia;
arg.gameObjIdSelf = GetComponent<BaseGameObjInfo>().gameObjID;
TrappedPathFindingCommand.Instance.Execute(GetComponent<BaseGameObjInfo>().gameObjID, arg);
}
}
InvokeRepeating("RandomPoint", 0f, 3f/*randominvoketime()*/);
}
@ -689,7 +703,7 @@ public class TrappedMoveFree : MonoBehaviour
GetComponent<TrappedPathFind>().pathFindEnable = false;
//设置碰撞器
//GetComponent<CapsuleCollider>().center = new Vector3(0f, 0.2f, 0f);
//GetComponent<CapsuleCollider>().direction = 0;
//GetComponent<CapsuleCollider>().direction = 0;
//nav.enabled = false;
// transform.position = transform.position + Vector3.up;
}
@ -743,7 +757,7 @@ public class TrappedMoveFree : MonoBehaviour
// return;
//}
//消防员不在附近,随机移动
if (!FireManNear)
//if (!FireManNear)
{
if (IsInvoking() == false)
{
@ -757,7 +771,7 @@ public class TrappedMoveFree : MonoBehaviour
{
if (timer == 1)
{
if (CurrentUserInfo.room!=null&&CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
if (CurrentUserInfo.room != null && CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
{
Vector3 dia = transform.position - DangerousLastmet;
targetPosition = dia;
@ -776,21 +790,21 @@ public class TrappedMoveFree : MonoBehaviour
}
}
}
//附近有消防员, 暂时停止移动
else
{
CancelInvoke("RandomPoint");
movestate = MoveState.IDLE;
}
////附近有消防员, 暂时停止移动
//else
//{
// CancelInvoke("RandomPoint");
// movestate = MoveState.IDLE;
//}
}
else if (!Guidance && !IsMoveState && firemanHit && !MeetDangerous)
{
if (IsInvoking() == true)
{
CancelInvokeRandom();
// CancelInvokeRandom();
StartCoroutine(WaitForFireman());
// StartCoroutine(WaitForFireman());
}
}
@ -849,7 +863,7 @@ public class TrappedMoveFree : MonoBehaviour
}
else if (guidPoint.Count > 1)
{
if (Vector3.Distance(transform.position, guidPoint[0]) < 0.5)
if (Vector3.Distance(transform.position, guidPoint[0]) < 2)
{
AddGuidIndex();
@ -915,9 +929,9 @@ public class TrappedMoveFree : MonoBehaviour
}
if (!firemanHit && !IsBefirstAirOrMoving)
{
if (CurrentUserInfo.room!=null&&CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
if (CurrentUserInfo.room != null && CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
{
float rang = UnityEngine.Random.Range(2f, 8f);
float rang = UnityEngine.Random.Range(4f, 8f);
StartCoroutine(randompoint(rang));
}

131
Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedPathFind.cs

@ -17,6 +17,7 @@ public class TrappedPathFind : MonoBehaviour
public List<Vector3> corners = new List<Vector3>();
private Vector3 lastPosition;
public bool pathFindEnable;
private NavMeshPath path;
/// <summary>
/// 是否被引导
/// </summary>
@ -29,6 +30,7 @@ public class TrappedPathFind : MonoBehaviour
filter = new NavMeshQueryFilter();
filter.agentTypeID = agent.agentTypeID;
filter.areaMask = agent.areaMask;
path = new NavMeshPath();
}
void OnEnable()
{
@ -73,7 +75,7 @@ public class TrappedPathFind : MonoBehaviour
removeNoMainCorners(corners);
StartCoroutine(GoToDestination(data));
//寻路同步
if (!GetComponent<TrappedMoveFree>().Guidance)
// if (!GetComponent<TrappedMoveFree>().Guidance)
{
PathFindSyncData pathsync = new PathFindSyncData();
pathsync.SendUserID = CurrentUserInfo.mySelf.Id;
@ -189,44 +191,41 @@ public class TrappedPathFind : MonoBehaviour
IEnumerator GoToDestination(TrappedPathFindingCmdArgs data)
{
int i = 1;
//while (i < corners.Count)
//{
// NavMeshPath NavMeshPath = new NavMeshPath();
// NavMesh.CalculatePath(transform.position, corners[i], filter, NavMeshPath);
// agent.SetDestination(corners[i]);
// while (agent.pathPending)
// yield return null;
// //wait until we reached this position
// float remain = Vector3.Distance(transform.position, corners[i]);
// while (remain == Mathf.Infinity || remain - agent.stoppingDistance > float.Epsilon)
// {
// //remain = Vector3.Distance(transform.position, corners[i]);
// yield return null;
// }
// var objinfo = GetComponent<BaseGameObjInfo>();
// if (objinfo.gameObjType == CloneObjType.fireman || objinfo.gameObjType == CloneObjType.ObligationFireman)
// {
// //setFloorMessage();
// }
// i++;
//}
NavMeshPath NavMeshPath = new NavMeshPath();
NavMesh.CalculatePath(transform.position, data.hitPoint, filter, NavMeshPath);
Vector3[] corns = NavMeshPath.corners;
while (i < corns.Length)
while (i < corners.Count)
{
agent.isStopped = false;
agent.SetDestination(corns[i]);
//wait until we reached this position
NavMeshPath NavMeshPath = new NavMeshPath();
NavMesh.CalculatePath(transform.position, corners[i], filter, NavMeshPath);
agent.SetDestination(corners[i]);
while (agent.pathPending)
yield return null;
while (agent.remainingDistance > agent.stoppingDistance)
//wait until we reached this position
float remain = Vector3.Distance(transform.position, corners[i]);
while (remain == Mathf.Infinity || remain - agent.stoppingDistance > float.Epsilon)
{
remain = Vector3.Distance(transform.position, corners[i]);
yield return null;
}
var objinfo = GetComponent<BaseGameObjInfo>();
i++;
}
//NavMeshPath NavMeshPath = new NavMeshPath();
//NavMesh.CalculatePath(transform.position, data.hitPoint, filter, NavMeshPath);
//Vector3[] corns = NavMeshPath.corners;
//while (i < corns.Length)
//{
// agent.isStopped = false;
// agent.SetDestination(corns[i]);
// //wait until we reached this position
// while (agent.pathPending)
// yield return null;
// while (agent.remainingDistance > agent.stoppingDistance)
// {
// yield return null;
// }
// i++;
//}
}
private void setFloorMessage()
{
@ -252,4 +251,74 @@ public class TrappedPathFind : MonoBehaviour
}
}
}
public List<Vector3> GetPathCornert(Vector3 endpoint, List<Vector3> corners)
{
List<Vector3> gocornert = new List<Vector3>();
bool isexit = SetPathCorners(transform.position, endpoint, corners);
if (isexit)
{
gocornert = corners;
}
return gocornert;
}
/// <summary>
/// 设置寻路路径上的拐角点集合,并返回是否有可寻路路径
/// </summary>
/// <param name="startingPos">起点位置</param>
/// <param name="destinationPos">终点位置</param>
/// <param name="corners">可寻路路径拐角点集合</param>
/// <returns>返回是否有可寻路路径</returns>
private bool SetPathCorners(Vector3 startingPos, Vector3 destinationPos, List<Vector3> corners)
{
NavMesh.CalculatePath(startingPos, destinationPos, filter, path);
Vector3[] tempCorners = new Vector3[path.corners.Length];
tempCorners = path.corners;
if (tempCorners.Length < 2)
{
return false;
}
if (path.status == NavMeshPathStatus.PathComplete)
{
foreach (Vector3 corner in tempCorners)
{
if (!corners.Contains(corner))
{
corners.Add(corner);
}
}
return true;
}
else if (path.status == NavMeshPathStatus.PathPartial)
{
foreach (Vector3 corner in tempCorners)
{
if (!corners.Contains(corner))
{
corners.Add(corner);
}
}
if (corners.Contains(tempCorners[tempCorners.Length - 1]))
{//1. 如果两个独立不连通的寻路区域会出现此种情况,这种情况下表明到达不了,返回false。
//2. 如果两个寻路区域,找不到最短到达路径,但有其他更长的路径可以到达,也可能出现此种情况
return false;
}
else
{
return SetPathCorners(tempCorners[tempCorners.Length - 1], destinationPos, corners);
}
}
else if (path.status == NavMeshPathStatus.PathInvalid)
{
return false;
}
else
{
return false;
}
}
public void Stopall()
{
StopAllCoroutines();
}
}

58
Assets/Scripts/Common/HelpClasses/WaterSource.cs

@ -12,7 +12,7 @@ public class WaterSourceSyncdata
public float AllUserWater;
public float TotalFlow;
public float AllUserFoam;
// public bool hasover;
// public bool hasover;
}
public class FlowValueChangeData
{
@ -32,7 +32,7 @@ public class WaterSource : MonoBehaviour
public float TotalFoam;//泡沫总量(单位:升)
public float AllUserFoam;//使用泡沫量
/// <summary>
/// 总流量
/// </summary>
@ -47,7 +47,7 @@ public class WaterSource : MonoBehaviour
set
{
totalFlow = value;
Debug.Log(name+"流量"+value);
Debug.Log(name + "流量" + value);
//分流
fenliu(value);
//修改连接管线的流量是否有水流通过,用以判断管线能否被删除
@ -115,7 +115,7 @@ public class WaterSource : MonoBehaviour
{//在出水,之前有水,现在没了,分流
if (GetComponent<TruckBindWaterSource>())
{
if (GetComponent<TruckBindWaterSource>().DirectConnectObj1.Key!=null)
if (GetComponent<TruckBindWaterSource>().DirectConnectObj1.Key != null)
{
if (GetComponent<TruckBindWaterSource>().DirectConnectObj1.Key.GetComponent<TruckBindWaterSource>())
{//出水口1直接连接的是车
@ -127,11 +127,11 @@ public class WaterSource : MonoBehaviour
}
}
if(GetComponent<TruckBindWaterSource>().DirectConnectObj2.Key!=null)
if (GetComponent<TruckBindWaterSource>().DirectConnectObj2.Key != null)
{
if (GetComponent<TruckBindWaterSource>().DirectConnectObj2.Key.GetComponent<TruckBindWaterSource>())
{//出水口2直接连接的是车
TruckBindWaterSource dircon2 = GetComponent<TruckBindWaterSource>().DirectConnectObj1.Key.GetComponent<TruckBindWaterSource>();
TruckBindWaterSource dircon2 = GetComponent<TruckBindWaterSource>().DirectConnectObj2.Key.GetComponent<TruckBindWaterSource>();
waterrunout(dircon2);
}
else
@ -145,7 +145,7 @@ public class WaterSource : MonoBehaviour
{//本来没水了,又链接上了水源
if (GetComponent<TruckBindWaterSource>())
{
if (GetComponent<TruckBindWaterSource>().DirectConnectObj1.Key!=null&& GetComponent<TruckBindWaterSource>().DirectConnectObj1.Key.GetComponent<TruckBindWaterSource>())
if (GetComponent<TruckBindWaterSource>().DirectConnectObj1.Key != null && GetComponent<TruckBindWaterSource>().DirectConnectObj1.Key.GetComponent<TruckBindWaterSource>())
{
if (GetComponent<TruckBindWaterSource>().DirectConnectObj1.Key.GetComponent<TruckBindWaterSource>())
{//出水口1直接连接的是车
@ -162,7 +162,7 @@ public class WaterSource : MonoBehaviour
waterConnectWhileNoWater(dircon2);
}
}
}
}
}
@ -201,7 +201,7 @@ public class WaterSource : MonoBehaviour
//}
if (GetComponent<TruckMessage>())
{
if(foam)
if (foam)
{
TotalWater = 15000;//15000
TotalFoam = 3000;//3000;
@ -209,10 +209,10 @@ public class WaterSource : MonoBehaviour
}
else
TotalWater = 12000; //12000;
TotalWater = 12000; //12000;
//水源车(水罐车,泡沫车)暂时用产品定的载水量,泡沫量
GetComponent<TruckMessage>().MyCarMessage.WaterAmount = (int)(TotalWater / 1000) ;//转换为吨
GetComponent<TruckMessage>().MyCarMessage.WaterAmount = (int)(TotalWater / 1000);//转换为吨
GetComponent<TruckMessage>().MyCarMessage.FoamAmount = (int)(TotalFoam / 1000);//转换为吨
}
else
@ -305,8 +305,8 @@ public class WaterSource : MonoBehaviour
ConnectGameObj = hose.GetComponent<ParentLinesMessage>().GetAnotherGameObj(GetComponent<BaseGameObjInfo>().gameObjID);
if (!GetComponent<TruckMessage>())
{//自己本身是消防设施(水源车辆在truckbindwatersource里处理过了)
GameObject end= EntitiesManager.Instance.GetEntityByID(data.EndId);
GameObject end = EntitiesManager.Instance.GetEntityByID(data.EndId);
//以下处理连接终端车辆哪个进水口
if (end.GetComponent<TruckBindWaterSource>())
{
@ -324,7 +324,7 @@ public class WaterSource : MonoBehaviour
}
else
{
Debug.LogError(end.name+"没有更多进水口");
Debug.LogError(end.name + "没有更多进水口");
}
}
WaterHoseEndDo arg = new WaterHoseEndDo
@ -336,7 +336,7 @@ public class WaterSource : MonoBehaviour
};
MessageDispatcher.SendMessage("StartConnectDone", arg);
}
}
}
@ -369,8 +369,8 @@ public class WaterSource : MonoBehaviour
GameobjId = GetComponent<BaseGameObjInfo>().gameObjID,
AllUserWater = AllUserWater,
TotalFlow = TotalFlow,
AllUserFoam=AllUserFoam
// hasover = hasover
AllUserFoam = AllUserFoam
// hasover = hasover
};
NetworkManager.Default.SendAsync("WATER_SOURCE_INFO_SYNC", arg);
@ -382,7 +382,7 @@ public class WaterSource : MonoBehaviour
{
if (tbws != null)
{//如果是水源车
if (tbws.GetComponent<BaseGameObjInfo>().UserID==CurrentUserInfo.mySelf.Id)
if (tbws.GetComponent<BaseGameObjInfo>().UserID == CurrentUserInfo.mySelf.Id)
{
var connect1 = tbws.WaterSourceLine1;
var connect2 = tbws.WaterSourceLine2;
@ -425,16 +425,16 @@ public class WaterSource : MonoBehaviour
}
}
}
// Debug.Log("tbws"+timer);
// Debug.Log("tbws"+timer);
}
}
else
{//本身是消防设施
if (hasover == false)
{
if (ConnectGameObj!=null)
if (ConnectGameObj != null)
{
if ( ConnectGameObj.GetComponent<BaseGameObjInfo>().UserID == CurrentUserInfo.mySelf.Id)
if (ConnectGameObj.GetComponent<BaseGameObjInfo>().UserID == CurrentUserInfo.mySelf.Id)
{
timer -= Time.deltaTime;
if (timer <= 0)
@ -527,7 +527,7 @@ public class WaterSource : MonoBehaviour
GameobjId = GetComponent<BaseGameObjInfo>().gameObjID,
AllUserWater = AllUserWater,
TotalFlow = TotalFlow,
AllUserFoam=AllUserFoam
AllUserFoam = AllUserFoam
//hasover = hasover
};
@ -587,8 +587,8 @@ public class WaterSource : MonoBehaviour
GameobjId = GetComponent<BaseGameObjInfo>().gameObjID,
AllUserWater = AllUserWater,
TotalFlow = TotalFlow,
AllUserFoam=AllUserFoam
// hasover = hasover
AllUserFoam = AllUserFoam
// hasover = hasover
};
NetworkManager.Default.SendAsync("WATER_SOURCE_INFO_SYNC", arg);
@ -698,7 +698,7 @@ public class WaterSource : MonoBehaviour
else
{
TotalFlow = TotalFlow - OutFlowInfoDic[changeid] + flow;
if (TotalFlow<0)
if (TotalFlow < 0)
{
TotalFlow = 0;
}
@ -787,7 +787,7 @@ public class WaterSource : MonoBehaviour
}
else if (tbws.WaterSourceLine1.Count <= 0 && tbws.WaterSourceLine2.Count <= 0)
{//两条线都没连接水源
}
}
}
@ -838,7 +838,7 @@ public class WaterSource : MonoBehaviour
if (dircon.GetComponent<WaterSource>())
{
WaterSource dirws = dircon.GetComponent<WaterSource>();
if (dirws.TotalWater<=dirws.AllUserWater)
if (dirws.TotalWater <= dirws.AllUserWater)
{
dirws.HasWaterSelfAndLine = false;
}
@ -907,7 +907,7 @@ public class WaterSource : MonoBehaviour
/// <param name="dircon1"></param>
void waterConnectWhileNoWater(TruckBindWaterSource dircon)
{
if (dircon.GetComponent<WaterSource>()&&dircon.GetComponent<WaterSource>().HasWaterSelfAndLine==false)
if (dircon.GetComponent<WaterSource>() && dircon.GetComponent<WaterSource>().HasWaterSelfAndLine == false)
{
dircon.GetComponent<WaterSource>().HasWaterSelfAndLine = true;
}
@ -984,7 +984,7 @@ public class WaterSource : MonoBehaviour
}
}
}
else if (dircon.WaterSourceLine1.Count > 0 && dircon.WaterSourceLine2.Count <= 0||
else if (dircon.WaterSourceLine1.Count > 0 && dircon.WaterSourceLine2.Count <= 0 ||
dircon.WaterSourceLine1.Count <= 0 && dircon.WaterSourceLine2.Count > 0)
{//只连接了一进水口,
if (dircon.GetComponent<WaterSource>())

25
Assets/Scripts/Common/Police/CommandingCtrl.cs

@ -6,14 +6,16 @@ using UnityEngine;
using System;
using AX.Serialization;
public class CommandingCtrl : MonoBehaviour {
public class CommandingCtrl : MonoBehaviour
{
private List<bool> isCommandbools = new List<bool>();//当前登陆用户所有上级的是否为总指挥值的集合
public GameObject PoliceInfo;
// Use this for initialization
void Start () {
void Start()
{
PoliceInfo = GameObject.Find("Canvas").transform.Find("Police/Main/PoliceInfo").gameObject;
NetworkMessageDispatcher.AddListener("GET_SUP_ISCOMMAND_SYNC", GetSupIsCommand);
@ -116,6 +118,14 @@ public class CommandingCtrl : MonoBehaviour {
|| CurrentUserInfo.role == Role.)
{
CurrentUserInfo.generalCommanding = true;//设置当前登陆用户为总指挥
foreach (UserData item in CurrentUserInfo.room.UserList)
{
if (CurrentUserInfo.mySelf.Id != item.UserInfo.Id)
{//不发给自己
NetworkManager.Default.SendAsync("GENERAL_COMMANDING_UPDATE_SYNC", item.UserInfo.Id);
}
}
}
}
else
@ -180,7 +190,7 @@ public class CommandingCtrl : MonoBehaviour {
isComdDatas.generalCommanding = CurrentUserInfo.generalCommanding;
isComdDatas.count = data.Value.Count;
NetworkManager.Default.SendAsync("EXIST_OTHER_DEPT_ISCMD_RESP_SYNC",
NetworkManager.Default.SendAsync("EXIST_OTHER_DEPT_ISCMD_RESP_SYNC",
new KeyValuePair<long, IsComdDatas>(data.Key, isComdDatas));
}
@ -192,7 +202,7 @@ public class CommandingCtrl : MonoBehaviour {
isComdDatas.generalCommanding = CurrentUserInfo.generalCommanding;
isComdDatas.count = data.Value.Count;
NetworkManager.Default.SendAsync("ISCOMMAND_SYNC", new KeyValuePair<long , IsComdDatas>(data.Key, isComdDatas));
NetworkManager.Default.SendAsync("ISCOMMAND_SYNC", new KeyValuePair<long, IsComdDatas>(data.Key, isComdDatas));
}
private void SetSupIsCommand(BinaryMessage message)
@ -226,8 +236,9 @@ public class CommandingCtrl : MonoBehaviour {
}
// Update is called once per frame
void Update () {
}
void Update()
{
}
}

26
Assets/Scripts/Common/Police/PoliceInfoMsgBind.cs

@ -116,7 +116,7 @@ public class PoliceInfoMsgBind : MonoBehaviour
GeneralCommandingUpdate();
RoleUICtrl.Instance.ShowRoleUI();
NetworkManager.Default.SendAsync("FIREDEPLOY_ARRIVED_SYNC",CurrentUserInfo.organization.DisplayName); //通知各客户端有中队车辆到场
NetworkManager.Default.SendAsync("FIREDEPLOY_ARRIVED_SYNC", CurrentUserInfo.organization.DisplayName); //通知各客户端有中队车辆到场
}
}
}
@ -130,7 +130,7 @@ public class PoliceInfoMsgBind : MonoBehaviour
//设置总指挥的逻辑处理
private void GeneralCommandingUpdate()
{
if (CurrentUserInfo.organization.Level != 5
if (CurrentUserInfo.organization.Level != 5
&& CurrentUserInfo.role != Role.
&& CurrentUserInfo.role != Role.
&& CurrentUserInfo.role != Role.
@ -191,7 +191,15 @@ public class PoliceInfoMsgBind : MonoBehaviour
if (Uids.Count == 0)
{
CurrentUserInfo.generalCommanding = true;
CurrentUserInfo.generalCommanding = true;//设置当前登陆用户为总指挥
foreach (UserData item in CurrentUserInfo.room.UserList)
{
if (CurrentUserInfo.mySelf.Id != item.UserInfo.Id)
{//不发给自己
NetworkManager.Default.SendAsync("GENERAL_COMMANDING_UPDATE_SYNC", item.UserInfo.Id);
}
}
}
else
{
@ -251,7 +259,15 @@ public class PoliceInfoMsgBind : MonoBehaviour
if (Uids.Count == 0)
{
CurrentUserInfo.generalCommanding = true;
CurrentUserInfo.generalCommanding = true;//设置当前登陆用户为总指挥
foreach (UserData item in CurrentUserInfo.room.UserList)
{
if (CurrentUserInfo.mySelf.Id != item.UserInfo.Id)
{//不发给自己
NetworkManager.Default.SendAsync("GENERAL_COMMANDING_UPDATE_SYNC", item.UserInfo.Id);
}
}
}
else
{
@ -283,7 +299,7 @@ public class PoliceInfoMsgBind : MonoBehaviour
}
}
}
}
private void FindAllSupID(int supId)

166
Assets/Scripts/Common/ReportSystem/ReportDataMgr.cs

@ -86,7 +86,7 @@ public class ReportDataMgr
// 提升投票
public static Dictionary<string, float> LevelUpScore = new Dictionary<string, float>();
public static List<ChatTaskMessage> AllChatMessage = new List<ChatTaskMessage>();
public static void ResertReportDataMgr()
public static void ResertReportDataMgr()
{
allTrucks.Clear();
allTrappedPerson.Clear();
@ -94,67 +94,67 @@ public class ReportDataMgr
allSendCommand.Clear();
allReceiverCommand.Clear();
allSubId.Clear();
totalTruckCount = 0.0f;
waterTankerCount = 0.0f;
foamTruckCount = 0.0f;
aerialTowerTruckCount = 0.0f;
highSprayingTruckCount = 0.0f;
ladderTruckCount = 0.0f;
smokeExhaustTruckCount = 0.0f;
rescueVehicleCount = 0.0f;
apparatusCount = 0.0f;
lightingApplianceCount = 0.0f;
repairCarCount = 0.0f;
forcibleEntryTruckCount = 0.0f;
totalTruckCount = 0.0f;
waterTankerCount = 0.0f;
foamTruckCount = 0.0f;
aerialTowerTruckCount = 0.0f;
highSprayingTruckCount = 0.0f;
ladderTruckCount = 0.0f;
smokeExhaustTruckCount = 0.0f;
rescueVehicleCount = 0.0f;
apparatusCount = 0.0f;
lightingApplianceCount = 0.0f;
repairCarCount = 0.0f;
forcibleEntryTruckCount = 0.0f;
totalFireman = 0;
totalUseWater = 0.0f;
totalSaveTrappedCount = 0.0f;
totalUseWater = 0.0f;
totalSaveTrappedCount = 0.0f;
totalSaveWoundedCount = 0;
totalSendCommand = 0;
totalReceiverCommand = 0;
IsVictory = false;
QuestionnaireNumber = 0;
SubmitQuestionnaireNumber = 0;
AllQuestionnaire.Clear();
FireScore = new Dictionary<string, float>();
SaveScore = new Dictionary<string, float>();
LookAtScore = new Dictionary<string, float>();
CoolScore = new Dictionary<string, float>();
WaterScore = new Dictionary<string, float>();
ActInScore = new Dictionary<string, float>();
ZhongDuiScore = new Dictionary<string, float>();
ZhiHuiScore = new Dictionary<string, float>();
StrengthScore = new Dictionary<string, float>();
WeaknessesScore = new Dictionary<string, float>();
NeedCarScore = new Dictionary<string, float>();
NeedFireEquipScore = new Dictionary<string, float>();
NeedSaveEquipScore = new Dictionary<string, float>();
VictoryScore = new Dictionary<string, float>();
DefeatScore = new Dictionary<string, float>();
LevelUpScore = new Dictionary<string, float>();
FireScore = new Dictionary<string, float>();
SaveScore = new Dictionary<string, float>();
LookAtScore = new Dictionary<string, float>();
CoolScore = new Dictionary<string, float>();
WaterScore = new Dictionary<string, float>();
ActInScore = new Dictionary<string, float>();
ZhongDuiScore = new Dictionary<string, float>();
ZhiHuiScore = new Dictionary<string, float>();
StrengthScore = new Dictionary<string, float>();
WeaknessesScore = new Dictionary<string, float>();
NeedCarScore = new Dictionary<string, float>();
NeedFireEquipScore = new Dictionary<string, float>();
NeedSaveEquipScore = new Dictionary<string, float>();
AllChatMessage = new List<ChatTaskMessage>();
VictoryScore = new Dictionary<string, float>();
DefeatScore = new Dictionary<string, float>();
LevelUpScore = new Dictionary<string, float>();
AllChatMessage = new List<ChatTaskMessage>();
}
public static void SetSendCommand(ChatTaskMessage chatTaskMessage)
{
@ -176,7 +176,7 @@ public class ReportDataMgr
{
chatidlist.Add(allSendCommand[i].ID);
}
if (!chatidlist.Contains(chatTaskMessage.ID))
if (!chatidlist.Contains(chatTaskMessage.ID))
{
allSendCommand.Add(chatTaskMessage);
}
@ -189,7 +189,7 @@ public class ReportDataMgr
{
chatidlist.Add(allReceiverCommand[i].ID);
}
if (!chatidlist.Contains(chatTaskMessage.ID))
if (!chatidlist.Contains(chatTaskMessage.ID))
{
allReceiverCommand.Add(chatTaskMessage);
}
@ -216,7 +216,7 @@ public class ReportDataMgr
GetAllCommandCount();
GetActInPersonCount();
}
public static void GetAllCommand()
public static void GetAllCommand()
{
totalSendCommand = 0;
totalReceiverCommand = 0;
@ -309,7 +309,7 @@ public class ReportDataMgr
// 获取救助被困人员字符串
public static string GetAllSaveCountString()
{
return string.Format("轻伤员{0}人,重伤员{1}人", totalSaveTrappedCount,totalSaveWoundedCount);
return string.Format("轻伤员{0}人,重伤员{1}人", totalSaveTrappedCount, totalSaveWoundedCount);
}
// 获取用液量字符串
public static string GetAllUserWaterString()
@ -392,6 +392,19 @@ public class ReportDataMgr
// // 检测是什么车
// CheckedTruckData(cloneGameObjInfo);
//}
//List<FireCarEngine> allivecar = new List<FireCarEngine>();
//foreach (var item in ArrivedPowerTotal.arrivedCars.Values)
//{
// foreach (var item1 in item)
// {
// int num = item1.Value;
// for (int i = 0; i < num; i++)
// {
// allivecar.Add(item1.Key);
// }
// }
//}
Transform allparent = GameObject.Find("P_AllParent").transform.Find("P_Cars");
TruckMessage[] allcar = allparent.GetComponentsInChildren<TruckMessage>();
foreach (var item in allcar)
@ -433,23 +446,42 @@ public class ReportDataMgr
if (CurrentUserInfo.role == Role. || CurrentUserInfo.role == Role.)
{
// 轻伤员
foreach (var item in allTrappedPerson)
//foreach (var item in allTrappedPerson)
//{
// TrappedMoveFree cloneGameObjInfo = item.GetComponent<TrappedMoveFree>();
// if (cloneGameObjInfo.SaveFrirmanUserId != 0)
// {
// totalSaveTrappedCount += 1;
// }
//}
//// 重伤员
//foreach (var item in allWoundedPerson)
//{
// WoundedSave cloneGameObjInfo = item.GetComponent<WoundedSave>();
// if (cloneGameObjInfo.SaveFrirmanUserId != 0)
// {
// totalSaveWoundedCount += 1;
// }
//}
totalSaveTrappedCount = 0;
totalSaveWoundedCount = 0;
Transform p_trapped = GameObject.Find("P_AllParent").transform.Find("P_Disasters/P_TrappedPerson");
Transform p_wound = GameObject.Find("P_AllParent").transform.Find("P_Disasters/P_Wounded");
for (int i = 0; i < p_trapped.childCount; i++)
{
TrappedMoveFree cloneGameObjInfo = item.GetComponent<TrappedMoveFree>();
if (cloneGameObjInfo.SaveFrirmanUserId != 0)
if (p_trapped.GetChild(i).GetComponent<TrappedMoveFree>().OverMoveOrGuidance)
{
totalSaveTrappedCount += 1;
totalSaveTrappedCount++;
}
}
// 重伤员
foreach (var item in allWoundedPerson)
for (int i = 0; i < p_wound.childCount; i++)
{
WoundedSave cloneGameObjInfo = item.GetComponent<WoundedSave>();
if (cloneGameObjInfo.SaveFrirmanUserId != 0)
if (p_wound.GetChild(i).GetComponent<WoundedSave>().OverMoveOrGuidance)
{
totalSaveWoundedCount += 1;
totalSaveWoundedCount++;
}
}
}
else
{
@ -1127,11 +1159,11 @@ public class ReportDataMgr
}
return receivechatlist;
}
public static string GetReceiveMsgCount()
public static string GetReceiveMsgCount()
{
return string.Format("{0}条", GetReceiveMsg().Count);
}
public static string GetSendMsgCount()
public static string GetSendMsgCount()
{
return string.Format("{0}条", GetSendMsg().Count);
}

6
Assets/Scripts/Common/User/CurrentUserInfo.cs

@ -27,4 +27,10 @@ public static class CurrentUserInfo
room = null;
generalCommanding = false;
}
public static void ResertExit()
{
role = Role.None;
room = null;
generalCommanding = false;
}
}

15
Assets/Scripts/DongYouLiQing/BaseCommander/FireRobotLayWaterHose.cs

@ -97,18 +97,18 @@ public class FireRobotLayWaterHose : MonoBehaviour
// Equip hose = EquipManager.Instance.GetEquipByID("82");
// hose.Number += (prve - value);
if (GetComponent<Bags>().HasEquip("消防高压水带"))
Debug.Log(GetComponent<Bags>().GetEquip("消防高压水带").Number+"收起前");
Debug.Log(GetComponent<Bags>().GetEquip("消防高压水带").Number + "收起前");
GetComponent<Bags>().AddEquip("82", (prve - value));
if (GetComponent<Bags>().HasEquip("消防高压水带"))
Debug.Log(GetComponent<Bags>().GetEquip("消防高压水带").Number+"收起后");
Debug.Log(GetComponent<Bags>().GetEquip("消防高压水带").Number + "收起后");
// waterHoseManage.WaterHoseLenghtRemain = waterHoseManage.NowRemainWaterHose * waterHoseManage.OneDefaultHoseLenght;
}
}
}
}
// public int hosenum;
// public int hosenum;
//public float hoseremain;
// Use this for initialization
void Start()
@ -146,8 +146,8 @@ public class FireRobotLayWaterHose : MonoBehaviour
ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().LineLenght = GetSelfConsumedLength();
ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().UseNum = Mathf.CeilToInt(GetSelfConsumedLength() / 20);
ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().RemainLenght = Mathf.CeilToInt(GetSelfConsumedLength() / 20) * 20 - GetSelfConsumedLength();
// hosenum = ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().UseNum;
// hoseremain = ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().RemainLenght;
// hosenum = ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().UseNum;
// hoseremain = ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().RemainLenght;
remainlenght = waterHoseManage.NowRemainWaterHose * waterHoseManage.OneDefaultHoseLenght + ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().RemainLenght;
waterHoseManage.WaterHoseLenghtRemain = remainlenght;
endPoint = transform.position;
@ -355,7 +355,10 @@ public class FireRobotLayWaterHose : MonoBehaviour
{
GetComponent<AgentController>().pathFindEnable = true;
}
agent.SetDestination(transform.position);
if (agent.enabled)
{
agent.SetDestination(transform.position);
}
if (remainlenght <= 0)
{
if (IsselfCurrent)

28
Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/Associated/ASSOCIATED_LINE_SYNC.cs

@ -32,8 +32,8 @@ public class ASSOCIATED_LINE_SYNC : NetworkMessageBehaviour
private GameObject parent;
//private long gameObjId;
//private GameObject startHitGameobj;
// private GameObject endHitGameobj;
// private Vector3 beginLinePoint;
// private GameObject endHitGameobj;
// private Vector3 beginLinePoint;
private Vector3 startPoint;
private Vector3 endPoint;
public float Height = 0.2f;
@ -52,12 +52,12 @@ public class ASSOCIATED_LINE_SYNC : NetworkMessageBehaviour
InputHistory.Instance.RegisterInputHistory(message);
var info = message.Body.Deserialize<AssociatedLineSyncDate>();
var sender = info.SendUserID;
// gameObjId = info.baseGameobjInfo.gameObjID;
// gameObjId = info.baseGameobjInfo.gameObjID;
if (InputManager.Instance)
{
if (CurrentUserInfo.mySelf.Id != sender)
{
if (info.startHitGameObjId!=0&&info.endHitGameObjId!=0)
if (info.startHitGameObjId != 0 && info.endHitGameObjId != 0)
{
Associatedline(info);
}
@ -67,7 +67,7 @@ public class ASSOCIATED_LINE_SYNC : NetworkMessageBehaviour
//{
// NetworkSyncHelper.AddSyncData(info);
//}
}
//private void Resert()
@ -84,8 +84,8 @@ public class ASSOCIATED_LINE_SYNC : NetworkMessageBehaviour
if (EntitiesManager.Instance.GetEntityByID(data.gameObjID) == null)
{
parentgameobj = EntitiesManager.Instance.CreateObj(parent, transform.position,transform, data.gameObjID);
parentgameobj = EntitiesManager.Instance.CreateObj(parent, transform.position, transform, data.gameObjID);
startPoint = data.LineBeginPoint;
}
else//第三个点及以上,找到前两个点创建的对象,将末位点赋给起点
@ -93,7 +93,7 @@ public class ASSOCIATED_LINE_SYNC : NetworkMessageBehaviour
parentgameobj = EntitiesManager.Instance.GetEntityByID(data.gameObjID);
startPoint = parentgameobj.GetComponent<ParentLinesMessage>().EndPoint;
}
endPoint = data.hitpoint;
float distance = Vector3.Distance(startPoint, endPoint);//计算两点的距离
Vector3 clonedObjPos = (startPoint + endPoint) / 2;
@ -104,7 +104,7 @@ public class ASSOCIATED_LINE_SYNC : NetworkMessageBehaviour
line.name = "line";
line.transform.position = clonedObjPos;
if((endPoint - startPoint)!=Vector3.zero)
if ((endPoint - startPoint) != Vector3.zero)
{
line.transform.forward = (-(endPoint - startPoint)).normalized;//改变线条的朝向
}
@ -136,17 +136,19 @@ public class ASSOCIATED_LINE_SYNC : NetworkMessageBehaviour
//startPoint = endPoint;
}
//同步管线连接到物体上的处理
void ConnectObj(GameObject startobj,GameObject endobj,GameObject hose)
void ConnectObj(GameObject startobj, GameObject endobj, GameObject hose)
{
if (startobj.GetComponent<FireManControl>()||startobj.GetComponent<TruckMessage>()||startobj.GetComponent<WaterConnonController>()
|| endobj.GetComponent<FireManControl>() || endobj.GetComponent<TruckMessage>() || endobj.GetComponent<WaterConnonController>())
if (startobj.GetComponent<FireManControl>() || startobj.GetComponent<TruckMessage>() || startobj.GetComponent<WaterConnonController>()
|| startobj.GetComponent<FireRobotController>()
|| endobj.GetComponent<FireManControl>() || endobj.GetComponent<TruckMessage>() || endobj.GetComponent<WaterConnonController>()
|| endobj.GetComponent<FireRobotController>())
{
HoseConnectOrDelectData data = new HoseConnectOrDelectData();
data.StartId = startobj.GetComponent<BaseGameObjInfo>().gameObjID;
data.EndId = endobj.GetComponent<BaseGameObjInfo>().gameObjID;
data.Isconnect = true;
data.HoseId = hose.GetComponent<BaseGameObjInfo>().gameObjID;
MessageDispatcher.SendMessage("HOSE_CONNECT_OR_DELECT",data);
MessageDispatcher.SendMessage("HOSE_CONNECT_OR_DELECT", data);
}
}
}

46
Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/Associated/TruckBindWaterSource.cs

@ -1537,33 +1537,37 @@ public class TruckBindWaterSource : MonoBehaviour
/// </summary>
private void JudeHightCarSpray()
{
bool isconnecttwo = true;
if (waterSourceLine1.Count < 1 || waterSourceLine2.Count < 1)
{//如果有一条线路没链接,内置判断为错
isconnecttwo = false;
}
else
if (GetComponent<CloneGameObjInfo>().gameObjType == CloneObjType.HighSprayingTruck)
{
long con1 = waterSourceLine1[0][0];//路线1 直接水源id
long con2 = waterSourceLine2[0][0];//路线2 直接水源id
if (con1==con2)
{//两个直接水源一样,则连在一个水源车上,内置判断为错
bool isconnecttwo = true;
if (waterSourceLine1.Count < 1 || waterSourceLine2.Count < 1)
{//如果有一条线路没链接,内置判断为错
isconnecttwo = false;
}
}
if (!isconnecttwo)
{
//发送错误报告同步信息
ReportErroeSyncData arg = new ReportErroeSyncData();
// (GetComponent<TIME_SYNC>())
else
{
arg.Time = TIME_SYNC.time;
long con1 = waterSourceLine1[0][0];//路线1 直接水源id
long con2 = waterSourceLine2[0][0];//路线2 直接水源id
if (con1 == con2)
{//两个直接水源一样,则连在一个水源车上,内置判断为错
isconnecttwo = false;
}
}
if (!isconnecttwo)
{
//发送错误报告同步信息
ReportErroeSyncData arg = new ReportErroeSyncData();
// (GetComponent<TIME_SYNC>())
{
arg.Time = TIME_SYNC.time;
}
arg.SendUserID = CurrentUserInfo.mySelf.Id;
arg.errorset = CurrentUserInfo.role.ToString();
arg.describe = "高喷车出水只连接一个水源";
NetworkManager.Default.SendAsync("REPORT_ERROR_SYNC", arg);
}
arg.SendUserID = CurrentUserInfo.mySelf.Id;
arg.errorset = CurrentUserInfo.role.ToString();
arg.describe = "高喷车出水只连接一个水源";
NetworkManager.Default.SendAsync("REPORT_ERROR_SYNC", arg);
}
}
/// <summary>
/// 喷泡沫

24
Assets/Scripts/DongYouLiQing/BaseCommander/HandOver/HandOverToggle.cs

@ -6,7 +6,8 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class HandOverToggle : BaseToggle {
public class HandOverToggle : BaseToggle
{
public GameObject panel;
public GameObject warnMark;
public override void RespondFun(bool value)
@ -19,7 +20,7 @@ public class HandOverToggle : BaseToggle {
}*/
warnMark.SetActive(false);
Panel.SetActive(value);
}
}
public GameObject Panel
{
get
@ -34,12 +35,18 @@ public class HandOverToggle : BaseToggle {
return panel;
}
}
// Use this for initialization
void Start () {
// Use this for initialization
void Start()
{
warnMark = transform.Find("WarnMark").gameObject;
warnMark.SetActive(false);
NetworkMessageDispatcher.AddListener("HAND_OVER_SYNC", OnReceivePower);
}
public override void OnDestroy()
{
base.OnDestroy();
NetworkMessageDispatcher.RemoveListener("HAND_OVER_SYNC", OnReceivePower);
}
void OnReceivePower(BinaryMessage message)
{
var pair = message.Body.Deserialize<HandOverPair>();
@ -51,11 +58,12 @@ public class HandOverToggle : BaseToggle {
{
warnMark.SetActive(true);
}
LoadPromptWin.Instance.LoadTextPromptWindow("获得消防力量控制权", 1);
LoadPromptWin.Instance.LoadTextPromptWindow("获得消防力量控制权", 1);
}
}
// Update is called once per frame
void Update () {
}
void Update()
{
}
}

26
Assets/Scripts/DongYouLiQing/BaseCommander/HandOver/ZDBHandOverToggle.cs

@ -6,7 +6,8 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ZDBHandOverToggle : BaseToggle {
public class ZDBHandOverToggle : BaseToggle
{
public GameObject panel;
public GameObject warnMark;
public override void RespondFun(bool value)
@ -35,12 +36,18 @@ public class ZDBHandOverToggle : BaseToggle {
}
}
// Use this for initialization
void Start () {
void Start()
{
warnMark = transform.Find("WarnMark").gameObject;
warnMark.SetActive(false);
NetworkMessageDispatcher.AddListener("HAND_OVER_SYNC", OnReceivePower);
}
void OnReceivePower(BinaryMessage message)
}
public override void OnDestroy()
{
base.OnDestroy();
NetworkMessageDispatcher.RemoveListener("HAND_OVER_SYNC", OnReceivePower);
}
void OnReceivePower(BinaryMessage message)
{
var pair = message.Body.Deserialize<HandOverPair>();
//如果“我”收到了移交的力量,就提示
@ -50,13 +57,14 @@ public class ZDBHandOverToggle : BaseToggle {
if (Panel.activeInHierarchy == false)
{
warnMark.SetActive(true);
}
}
LoadPromptWin.Instance.LoadTextPromptWindow("获得消防力量控制权", 2);
//GetComponent<Toggle>().isOn = true;
}
}
// Update is called once per frame
void Update () {
}
// Update is called once per frame
void Update()
{
}
}

35
Assets/Scripts/DongYouLiQing/LeadGroup/FireInfoListToggle.cs

@ -1,15 +1,44 @@
using UnityEngine;
using AX.MessageSystem;
using System;
using UnityEngine.UI;
public class FireInfoListToggle : BaseToggle {
public class FireInfoListToggle : BaseToggle
{
private Transform mFireSitePopup;
Toggle thistoggle;
void Start()
{
mFireSitePopup = transform.parent.transform.Find("FireSiteInfoPopup");
mFireSitePopup = transform.parent.transform.Find("FireSiteInfoPopup");
MessageDispatcher.AddListener("CloseFireInfoPanel", Closetoggle);
thistoggle = GetComponent<Toggle>();
}
public override void OnDestroy()
{
base.OnDestroy();
MessageDispatcher.RemoveListener("CloseFireInfoPanel", Closetoggle);
}
private void Closetoggle(IMessage obj)
{
if (!thistoggle.isOn)
{
//FireInfoToggle[] toggles = GetComponentsInChildren<FireInfoToggle>(true);
//for (int i = 0; i < toggles. Length; i++)
//{
// if (toggles[i].name==num.ToString())
// {
// toggles[i].GetComponent<Toggle>().isOn = false;
// }
//}
thistoggle.isOn = true;
MessageDispatcher.SendMessage("CloseFireInfoPanel", (int)obj.Data);
thistoggle.isOn = false;
}
}
public override void RespondFun(bool value)
{
mFireSitePopup.gameObject.SetActive(value);
}
}
}

Loading…
Cancel
Save