|
|
|
@ -323,7 +323,7 @@ public class LayWaterHose : MonoBehaviour
|
|
|
|
|
/// <summary> |
|
|
|
|
/// 开始铺设水带 |
|
|
|
|
/// </summary> |
|
|
|
|
public void StartLay() |
|
|
|
|
public void StartLay(bool issync = false) |
|
|
|
|
{ |
|
|
|
|
agent.SetDestination(transform.position); |
|
|
|
|
//if (GetComponent<FireManWaterHoseManager>().OverLenght > 0) |
|
|
|
@ -376,6 +376,8 @@ public class LayWaterHose : MonoBehaviour
|
|
|
|
|
} |
|
|
|
|
//更新消防员水源信息 |
|
|
|
|
if (ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().WaterSource != null) |
|
|
|
|
{ |
|
|
|
|
if (issync == false) |
|
|
|
|
{ |
|
|
|
|
gameObject.GetComponent<FireManWaterHoseManager>().ResetWaterSourceConnectInfo |
|
|
|
|
(true, ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().ConnectWater, |
|
|
|
@ -386,10 +388,15 @@ public class LayWaterHose : MonoBehaviour
|
|
|
|
|
FireManSkillPanelController.Instance.SprayWater.GetComponent<Toggle>().interactable = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
if (issync == false) |
|
|
|
|
{ |
|
|
|
|
gameObject.GetComponent<FireManWaterHoseManager>().ResetWaterSourceConnectInfo(false, false, false, null, null); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
flag = true; |
|
|
|
|
ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().ConnectFireman = gameObject; |
|
|
|
|
} |
|
|
|
@ -441,7 +448,7 @@ public class LayWaterHose : MonoBehaviour
|
|
|
|
|
/// <summary> |
|
|
|
|
/// 消防员喷水、泡沫时铺设水带 |
|
|
|
|
/// </summary> |
|
|
|
|
public void StartSprayingLay() |
|
|
|
|
public void StartSprayingLay(bool issync = false) |
|
|
|
|
{ |
|
|
|
|
agent.SetDestination(transform.position); |
|
|
|
|
if (!GetComponent<AgentController>().pathFindEnable) |
|
|
|
@ -458,20 +465,27 @@ public class LayWaterHose : MonoBehaviour
|
|
|
|
|
if (endPoint != Vector3.zero && Vector3.Distance(transform.position, endPoint) < 5) |
|
|
|
|
{ |
|
|
|
|
if (ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().WaterSource != null) |
|
|
|
|
{ |
|
|
|
|
if (issync == false) |
|
|
|
|
{ |
|
|
|
|
gameObject.GetComponent<FireManWaterHoseManager>().ResetWaterSourceConnectInfo |
|
|
|
|
(true, ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().ConnectWater, |
|
|
|
|
ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().ConnectFoam, ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().WaterSource, |
|
|
|
|
ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().ConnectWaterHose); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (/*FindObjectOfType<FireManSkillPanelController>()*/FireManSkillPanelController.Instance) |
|
|
|
|
{ |
|
|
|
|
FireManSkillPanelController.Instance.SprayWater.GetComponent<Toggle>().interactable = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
if (issync == false) |
|
|
|
|
{ |
|
|
|
|
gameObject.GetComponent<FireManWaterHoseManager>().ResetWaterSourceConnectInfo(false, false, false, null, null); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//GetComponent<FireManWaterHoseManager>().WaterHoseLenghtRemain = |
|
|
|
|
// GetComponent<FireManWaterHoseManager>().NowRemainWaterHose * 20 + ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().RemainLenght;//+ GetComponent<FireManWaterHoseManager>().OverLenght; |
|
|
|
|
// GetComponent<FireManWaterHoseManager>().NowRemainWaterHose = GetComponent<FireManWaterHoseManager>().NowRemainWaterHose + ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().UseNum; |
|
|
|
@ -497,7 +511,7 @@ public class LayWaterHose : MonoBehaviour
|
|
|
|
|
/// <summary> |
|
|
|
|
/// 结束铺设,放下水带 |
|
|
|
|
/// </summary> |
|
|
|
|
public void EndLay() |
|
|
|
|
public void EndLay(bool issync = false, bool isstoplayskill = true) |
|
|
|
|
{ |
|
|
|
|
//endlay(); |
|
|
|
|
if (flag) |
|
|
|
@ -505,7 +519,7 @@ public class LayWaterHose : MonoBehaviour
|
|
|
|
|
|
|
|
|
|
flag = false; |
|
|
|
|
agent.SetDestination(transform.position); //停止移动 |
|
|
|
|
SetLayHoseInfo(); |
|
|
|
|
SetLayHoseInfo(issync,isstoplayskill); |
|
|
|
|
//lengthDic.Clear();//清空本次绘制存储的线 |
|
|
|
|
//IsTackUp = false; |
|
|
|
|
//TackHose = null; |
|
|
|
@ -521,7 +535,7 @@ public class LayWaterHose : MonoBehaviour
|
|
|
|
|
/// <summary> |
|
|
|
|
/// 结束铺设时设置该铺设管线信息 |
|
|
|
|
/// </summary> |
|
|
|
|
void SetLayHoseInfo() |
|
|
|
|
void SetLayHoseInfo(bool issync = false,bool isstoplayskill=true) |
|
|
|
|
{ |
|
|
|
|
// LastLenght = GetSelfConsumedLength() - ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().LineLenght; |
|
|
|
|
|
|
|
|
@ -551,8 +565,35 @@ public class LayWaterHose : MonoBehaviour
|
|
|
|
|
{ |
|
|
|
|
GetComponent<AgentController>().pathFindEnable = false; |
|
|
|
|
} |
|
|
|
|
// StartCoroutine(closespraytoggle()); |
|
|
|
|
//if (!(endPoint != Vector3.zero && Vector3.Distance(transform.position, endPoint) < 5)) |
|
|
|
|
//{ |
|
|
|
|
// if (FireManSkillPanelController.Instance) |
|
|
|
|
// { |
|
|
|
|
// FireManSkillPanelController.Instance.SprayWater.GetComponent<Toggle>().isOn = false; |
|
|
|
|
// FireManSkillPanelController.Instance.SprayWater.GetComponent<Toggle>().interactable = false; |
|
|
|
|
// } |
|
|
|
|
//} |
|
|
|
|
if (issync==false) |
|
|
|
|
{ |
|
|
|
|
GetComponent<FireManWaterHoseManager>().Resert(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
IEnumerator closespraytoggle() |
|
|
|
|
{ |
|
|
|
|
yield return new WaitForSeconds(0.2f); |
|
|
|
|
if (GetComponent<FireManControl>().WorkType!=FireManSkills.SprayFoam&& |
|
|
|
|
GetComponent<FireManControl>().WorkType != FireManSkills.SprayWater || |
|
|
|
|
!FireManSkillPanelController.Instance.extinguishantSelect.gameObject.activeSelf) |
|
|
|
|
{ |
|
|
|
|
//if (FireManSkillPanelController.Instance) |
|
|
|
|
{ |
|
|
|
|
FireManSkillPanelController.Instance.SprayWater.GetComponent<Toggle>().isOn = false; |
|
|
|
|
FireManSkillPanelController.Instance.SprayWater.GetComponent<Toggle>().interactable = false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/// <summary> |
|
|
|
|
/// 收起水带 |
|
|
|
|
/// </summary> |
|
|
|
@ -894,6 +935,8 @@ public class LayWaterHose : MonoBehaviour
|
|
|
|
|
if (ParentLayHose!=null&& ParentLayHose.GetComponent<ParentLayWaterHoseMsg>()!=null) |
|
|
|
|
{ |
|
|
|
|
if (ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().WaterSource != null) |
|
|
|
|
{ |
|
|
|
|
if ((endPoint != Vector3.zero && Vector3.Distance(transform.position, endPoint) < 5)) |
|
|
|
|
{ |
|
|
|
|
gameObject.GetComponent<FireManWaterHoseManager>().ResetWaterSourceConnectInfo |
|
|
|
|
(true, ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().ConnectWater, |
|
|
|
@ -902,8 +945,15 @@ public class LayWaterHose : MonoBehaviour
|
|
|
|
|
if (/*FindObjectOfType<FireManSkillPanelController>()*/FireManSkillPanelController.Instance) |
|
|
|
|
{ |
|
|
|
|
FireManSkillPanelController.Instance.SprayWater.GetComponent<Toggle>().interactable = true; |
|
|
|
|
DrawByTimespan(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
LoadPromptWin.Instance.LoadTextPromptWindow("距离太远,无法自动拿起管线", 1f); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |