Browse Source

出水同步时,其他客户端报错。原因为关闭出水时调用了结束管线铺设的方法,这个方法里重置了水源信息,同步的客户端再次出水时因为没有调用出水按钮的方法,没有重新赋值出水信息,找不到水源信息了。

铺设管线结束后,不管走到哪都可以出水。修改为结束铺设后,5米内可以自动连接之前放下的管线出水
develop
曹衍涛 4 years ago
parent
commit
8c511272b9
  1. 4
      Assets/Scripts/Common/ChatSystem/FireSiteInfo/FireInfoToggle.cs
  2. 46
      Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/Associated/CloneWaterHoseLines.cs
  3. 40
      Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/Associated/FireManWaterHoseManager.cs
  4. 2
      Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/LayWaterHose/LAY_WATER_HOSE_SYNC.cs
  5. 118
      Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/LayWaterHose/LayWaterHose.cs
  6. 21
      Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/SprayWater/ExtinguishantSelectPanel.cs
  7. 5
      Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/SprayWater/SPRAY_WATER_SYNC.cs
  8. 19
      Assets/Scripts/DongYouLiQing/BaseCommander/SkillPanel/FireManSkillPanelController.cs

4
Assets/Scripts/Common/ChatSystem/FireSiteInfo/FireInfoToggle.cs

@ -14,8 +14,8 @@ public class FireInfoToggle : BaseToggle
}
public override void OnDisable()
{
//base.OnDisable();
//MessageDispatcher.RemoveListener("CloseFireInfoPanel", CancelToggle);
base.OnDisable();
MessageDispatcher.RemoveListener("CloseFireInfoPanel", CancelToggle);
}
public override void OnDestroy()
{

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

@ -256,29 +256,7 @@ public class CloneWaterHoseLines : CloneBase
//设置楼层属性
Setattribute(data.gameObjID, parentgameobj);
if (endHitGameobj.GetComponent<FireManControl>() ||
endHitGameobj.GetComponent<WaterConnonController>() ||
endHitGameobj.GetComponent<SnowConnonController>() ||
endHitGameobj.GetComponent<FireRobotController>() ||
endHitGameobj.GetComponent<TruckMessage>() ||
startHitGameobj.GetComponent<WaterSource>())
{
if (endHitGameobj.GetComponent<FireManControl>() ||
endHitGameobj.GetComponent<WaterConnonController>() ||
endHitGameobj.GetComponent<SnowConnonController>() ||
endHitGameobj.GetComponent<FireRobotController>() ||
endHitGameobj.GetComponent<TruckMessage>())
{
LoadPromptWin.Instance.LoadTextPromptWindow("连接成功",1f);
}
var arg = new HoseConnectOrDelectData();
arg.StartId = startHitGameobj.GetComponent<BaseGameObjInfo>().gameObjID;
arg.EndId = endHitGameobj.GetComponent<BaseGameObjInfo>().gameObjID;
arg.HoseId = parentgameobj.GetComponent<BaseGameObjInfo>().gameObjID;
arg.Isconnect = true;
MessageDispatcher.SendMessage("HOSE_CONNECT_OR_DELECT", arg);
}
//connentFireMan();
//connentWaterCannon();
@ -310,7 +288,29 @@ public class CloneWaterHoseLines : CloneBase
//同步
CloneInfoSync(endPoint);
if (endHitGameobj.GetComponent<FireManControl>() ||
endHitGameobj.GetComponent<WaterConnonController>() ||
endHitGameobj.GetComponent<SnowConnonController>() ||
endHitGameobj.GetComponent<FireRobotController>() ||
endHitGameobj.GetComponent<TruckMessage>() ||
startHitGameobj.GetComponent<WaterSource>())
{
if (endHitGameobj.GetComponent<FireManControl>() ||
endHitGameobj.GetComponent<WaterConnonController>() ||
endHitGameobj.GetComponent<SnowConnonController>() ||
endHitGameobj.GetComponent<FireRobotController>() ||
endHitGameobj.GetComponent<TruckMessage>())
{
LoadPromptWin.Instance.LoadTextPromptWindow("连接成功", 1f);
}
var arg = new HoseConnectOrDelectData();
arg.StartId = startHitGameobj.GetComponent<BaseGameObjInfo>().gameObjID;
arg.EndId = endHitGameobj.GetComponent<BaseGameObjInfo>().gameObjID;
arg.HoseId = parentgameobj.GetComponent<BaseGameObjInfo>().gameObjID;
arg.Isconnect = true;
MessageDispatcher.SendMessage("HOSE_CONNECT_OR_DELECT", arg);
}
//如果连接到消防车、消防员或者水源上,重置信息,准备另画一条水带
if (endHitGameobj.GetComponent<WaterSource>() ||
endHitGameobj.GetComponent<FireManControl>() ||

40
Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/Associated/FireManWaterHoseManager.cs

@ -85,7 +85,7 @@ public class FireManWaterHoseManager : MonoBehaviour
}
public void OnEnable()
public void Awake()
{
MessageDispatcher.AddListener("WATERHOSEEXPEND", HoseExpend);
MessageDispatcher.AddListener("PACK_OR_TACK_HOSE_COMMAND", PackOrTackHose);
@ -324,6 +324,12 @@ public class FireManWaterHoseManager : MonoBehaviour
FireManSkillPanelController.Instance.LayWaterHoseToggle.GetComponent<Toggle>().isOn = true;
FireManSkillPanelController.Instance.SprayWater.GetComponent<Toggle>().interactable = true;
}
//var arg = new HoseConnectOrDelectData();
//arg.StartId = hosemsg.WaterSource.GetComponent<BaseGameObjInfo>().gameObjID;
//arg.EndId = GetComponent<BaseGameObjInfo>().gameObjID;
//arg.HoseId = hosemsg.ConnectWaterHose.GetComponent<BaseGameObjInfo>().gameObjID;
//arg.Isconnect = true;
//MessageDispatcher.SendMessage("HOSE_CONNECT_OR_DELECT", arg);
}
else
{
@ -530,27 +536,31 @@ public class FireManWaterHoseManager : MonoBehaviour
/// <param name="connectsource">是否有水源</param>
/// <param name="water"></param>
/// <param name="foam"></param>
public void ResetWaterSourceConnectInfo(bool connectsource, bool water, bool foam, GameObject watersource, GameObject connecthose)
public void ResetWaterSourceConnectInfo(bool connectsource, bool water, bool foam, GameObject watersource, GameObject connecthose,bool issync=false)
{
IsConnentWaterSource = connectsource;
hasWaterConnect = water;
hasFoamConnect = foam;
ConnentSource = watersource;
WaterLineConnent = connecthose;
if (connecthose != null)
if (issync==false)
{
IsConnentWaterLine = true;
}
if (connectsource)
{
if (FireManSkillPanelController.Instance)
IsConnentWaterSource = connectsource;
hasWaterConnect = water;
hasFoamConnect = foam;
ConnentSource = watersource;
WaterLineConnent = connecthose;
if (connecthose != null)
{
if (SelectedObjs.selectedObj == gameObject)
IsConnentWaterLine = true;
}
if (connectsource)
{
if (FireManSkillPanelController.Instance)
{
FireManSkillPanelController.Instance.SprayWater.GetComponent<Toggle>().interactable = true;
if (SelectedObjs.selectedObj == gameObject)
{
FireManSkillPanelController.Instance.SprayWater.GetComponent<Toggle>().interactable = true;
}
}
}
}
}
/// <summary>
/// 重置连接水带信息

2
Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/LayWaterHose/LAY_WATER_HOSE_SYNC.cs

@ -78,7 +78,7 @@ public class LAY_WATER_HOSE_SYNC : NetworkMessageBehaviour
}
else
{
GetComponent<LayWaterHose>().EndLay();
GetComponent<LayWaterHose>().EndLay(true);
}
}
}

118
Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/LayWaterHose/LayWaterHose.cs

@ -60,10 +60,10 @@ public class LayWaterHose : MonoBehaviour
/// <summary>
/// 如果是本客户端
/// </summary>
public bool IsselfCurrent=true;
public bool IsselfCurrent = true;
private int creatnum = 1;
// private bool setInitpoint;
// public float LastLenght;
// private bool setInitpoint;
// public float LastLenght;
//private float LastLayLenght;
// Use this for initialization
void Start()
@ -156,12 +156,12 @@ public class LayWaterHose : MonoBehaviour
// Update is called once per frame
void Update()
{
//Debug.Log(flag+"//"+ agent.velocity.magnitude );
if (flag && agent.velocity.magnitude > 0) //开启“铺设水带”,并且开始寻路时才会执行
{
remainlenght = GetComponent<FireManWaterHoseManager>().WaterHoseLenghtRemain;
endPoint = transform.position;
//LayLenght= GetSelfConsumedLength();
if (remainlenght > 0 && remainlenght <= 0.5f) //临界带
@ -173,7 +173,7 @@ public class LayWaterHose : MonoBehaviour
LoadPromptWin.Instance.LoadTextPromptWindow("水带用完", 1f);
}
}
DrawByTimespan();//按更新的铺设路线画一次水带
}
@ -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)
@ -349,7 +349,7 @@ public class LayWaterHose : MonoBehaviour
}
//ParentLayHose = EntitiesManager.Instance.CreateObj(ParentLayHosePrefabs, Vector3.zero,
// WaterHoses.transform, EntitiesManager.Instance.CreateObjID(CurrentUserInfo.mySelf.Id)); // Instantiate(ParentLayHosePrefabs, WaterHoses.transform);
ParentLayHose=Instantiate(ParentLayHosePrefabs, WaterHoses.transform);
ParentLayHose = Instantiate(ParentLayHosePrefabs, WaterHoses.transform);
//ParentLayHose.GetComponent<BaseGameObjInfo>().gameObjID = EntitiesManager.Instance.CreateObjID(CurrentUserInfo.mySelf.Id);
ParentLayHose.name = "LayWaterHose" + creatnum;
creatnum++;
@ -358,7 +358,7 @@ public class LayWaterHose : MonoBehaviour
AddInit();
endPoint = transform.position;
flag = true;
}
//如果放下期间没有被别人捡起,继续铺设
else
@ -377,18 +377,25 @@ public class LayWaterHose : MonoBehaviour
//更新消防员水源信息
if (ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().WaterSource != null)
{
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)
if (issync == false)
{
FireManSkillPanelController.Instance.SprayWater.GetComponent<Toggle>().interactable = true;
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
{
gameObject.GetComponent<FireManWaterHoseManager>().ResetWaterSourceConnectInfo(false, false, false, null, null);
if (issync == false)
{
gameObject.GetComponent<FireManWaterHoseManager>().ResetWaterSourceConnectInfo(false, false, false, null, null);
}
}
flag = true;
ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().ConnectFireman = gameObject;
@ -419,12 +426,12 @@ public class LayWaterHose : MonoBehaviour
FireManWaterHoseManager thisFireman = GetComponent<FireManWaterHoseManager>();
ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().BindWaterSource(thisFireman.hasWaterConnect, thisFireman.hasFoamConnect, thisFireman.ConnentSource, thisFireman.WaterLineConnent);
}
allInits.Clear();
AddInit();
endPoint = transform.position;
flag = true;
}
}
@ -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)
@ -459,10 +466,14 @@ public class LayWaterHose : MonoBehaviour
{
if (ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().WaterSource != null)
{
gameObject.GetComponent<FireManWaterHoseManager>().ResetWaterSourceConnectInfo
(true, ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().ConnectWater,
ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().ConnectFoam, ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().WaterSource,
ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().ConnectWaterHose);
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;
@ -470,7 +481,10 @@ public class LayWaterHose : MonoBehaviour
}
else
{
gameObject.GetComponent<FireManWaterHoseManager>().ResetWaterSourceConnectInfo(false, false, false, null, null);
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;
@ -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,11 +535,11 @@ public class LayWaterHose : MonoBehaviour
/// <summary>
/// 结束铺设时设置该铺设管线信息
/// </summary>
void SetLayHoseInfo()
void SetLayHoseInfo(bool issync = false,bool isstoplayskill=true)
{
// LastLenght = GetSelfConsumedLength() - ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().LineLenght;
// LastLenght = GetSelfConsumedLength() - ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().LineLenght;
ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().LineLenght = GetSelfConsumedLength();
ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().UseNum = Mathf.CeilToInt(GetSelfConsumedLength() / 20);
ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().CreatFireman = gameObject;
@ -546,12 +560,39 @@ public class LayWaterHose : MonoBehaviour
{
ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().BindWaterSource(false, false, null, null);
}
if (GetComponent<FireManControl>().workType==FireManSkills.SprayFoam||
if (GetComponent<FireManControl>().workType == FireManSkills.SprayFoam ||
GetComponent<FireManControl>().workType == FireManSkills.SprayWater)
{
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>
/// 收起水带
@ -895,14 +936,23 @@ public class LayWaterHose : MonoBehaviour
{
if (ParentLayHose.GetComponent<ParentLayWaterHoseMsg>().WaterSource != null)
{
gameObject.GetComponent<FireManWaterHoseManager>().ResetWaterSourceConnectInfo
if ((endPoint != Vector3.zero && Vector3.Distance(transform.position, endPoint) < 5))
{
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)
if (/*FindObjectOfType<FireManSkillPanelController>()*/FireManSkillPanelController.Instance)
{
FireManSkillPanelController.Instance.SprayWater.GetComponent<Toggle>().interactable = true;
DrawByTimespan();
}
}
else
{
FireManSkillPanelController.Instance.SprayWater.GetComponent<Toggle>().interactable = true;
LoadPromptWin.Instance.LoadTextPromptWindow("距离太远,无法自动拿起管线", 1f);
}
}
}
}

21
Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/SprayWater/ExtinguishantSelectPanel.cs

@ -54,6 +54,17 @@ private void foambuttonClick()
//worksync.gameObjType = SelectFireman.GetComponent<BaseGameObjInfo>().gameObjType;
//NetworkManager.Default.SendAsync(/*CurrentUserInfo.mySelf.Id,*/ "FIREMAN_WORKTYPECHANGE_SYNC", worksync);
//if (SelectFireman.GetComponent<FireManWaterHoseManager>())
//{
// var arg = new HoseConnectOrDelectData();
// arg.StartId = SelectFireman.GetComponent<FireManWaterHoseManager>().ConnentSource.GetComponent<BaseGameObjInfo>().gameObjID;
// arg.EndId = SelectFireman.GetComponent<BaseGameObjInfo>().gameObjID;
// arg.HoseId = SelectFireman.GetComponent<FireManWaterHoseManager>().WaterLineConnent.GetComponent<BaseGameObjInfo>().gameObjID;
// arg.Isconnect = true;
// MessageDispatcher.SendMessage("HOSE_CONNECT_OR_DELECT", arg);
//}
//出水同步
SpraySyncData spraysync = new SpraySyncData();
spraysync.spraytype = SprayParticleType.Froth;
@ -93,6 +104,16 @@ private void foambuttonClick()
//worksync.gameObjType = SelectFireman.GetComponent<BaseGameObjInfo>().gameObjType;
//NetworkManager.Default.SendAsync(/*CurrentUserInfo.mySelf.Id,*/ "FIREMAN_WORKTYPECHANGE_SYNC", worksync);
//出水同步
//if (SelectFireman.GetComponent<FireManWaterHoseManager>())
//{
// var arg = new HoseConnectOrDelectData();
// arg.StartId = SelectFireman.GetComponent<FireManWaterHoseManager>().ConnentSource.GetComponent<BaseGameObjInfo>().gameObjID;
// arg.EndId = SelectFireman.GetComponent<BaseGameObjInfo>().gameObjID;
// arg.HoseId = SelectFireman.GetComponent<FireManWaterHoseManager>().WaterLineConnent.GetComponent<BaseGameObjInfo>().gameObjID;
// arg.Isconnect = true;
// MessageDispatcher.SendMessage("HOSE_CONNECT_OR_DELECT", arg);
//}
SpraySyncData spraysync = new SpraySyncData();
spraysync.SendUserID = CurrentUserInfo.mySelf.Id;
spraysync.spraytype = SprayParticleType.WaterStraight;

5
Assets/Scripts/DongYouLiQing/BaseCommander/FiremanSkill/SprayWater/SPRAY_WATER_SYNC.cs

@ -51,7 +51,7 @@ public class SPRAY_WATER_SYNC : NetworkMessageBehaviour
if (Sprayobj.GetComponent<FireManControl>())
{
Sprayobj.GetComponent<LayWaterHose>().IsselfCurrent = false;
Sprayobj.GetComponent<LayWaterHose>().EndLay();
Sprayobj.GetComponent<LayWaterHose>().EndLay(true);
Sprayobj.GetComponent<Animator>().SetBool("isInSitu", false);
Hose.parent.gameObject.SetActive(false);
}
@ -104,9 +104,10 @@ public class SPRAY_WATER_SYNC : NetworkMessageBehaviour
if (sprayObj.GetComponent<FireManControl>())
{
sprayObj.GetComponent<LayWaterHose>().IsselfCurrent = false;
sprayObj.GetComponent<LayWaterHose>().StartSprayingLay();
sprayObj.GetComponent<LayWaterHose>().StartSprayingLay(true);
sprayObj.GetComponent<Animator>().SetBool("isInSitu", true);
Hose.parent.gameObject.SetActive(true);
}
if (sprayObj.GetComponent<TruckMessage>())
{

19
Assets/Scripts/DongYouLiQing/BaseCommander/SkillPanel/FireManSkillPanelController.cs

@ -722,6 +722,11 @@ public class FireManSkillPanelController : MonoBehaviour
// LoadPromptWin.Instance.LoadTextPromptWindow("剩余水量不足", 1f);
// return;
//}
if(SelectFireMan.GetComponent<FireManWaterHoseManager>().ConnentSource==null)
{
SprayWater.GetComponent<Toggle>().isOn = false;
return;
}
float remain = SelectFireMan.GetComponent<FireManControl>().CheckWaterRemain(SelectFireMan.GetComponent<FireManWaterHoseManager>().WaterSourceLine);
if (!(remain>0||remain==-100))
{
@ -755,8 +760,15 @@ public class FireManSkillPanelController : MonoBehaviour
SelectFireMan.GetComponent<LayWaterHose>().StartSprayingLay();
//连接水源流量设置
// MessageDispatcher.SendMessage("SPRAY_WATER", new flowchangeinfo() { IsAdd = true, ChangObjId = SelectFireMan.GetComponent<BaseGameObjInfo>().gameObjID });
// MessageDispatcher.SendMessage("SPRAY_WATER", new flowchangeinfo() { IsAdd = true, ChangObjId = SelectFireMan.GetComponent<BaseGameObjInfo>().gameObjID });
////同步水源信息
//var arg = new HoseConnectOrDelectData();
//arg.StartId = SelectFireMan.GetComponent<FireManWaterHoseManager>().ConnentSource.GetComponent<BaseGameObjInfo>().gameObjID;
//arg.EndId = SelectFireMan.GetComponent<BaseGameObjInfo>().gameObjID;
//arg.HoseId = SelectFireMan.GetComponent<FireManWaterHoseManager>().WaterLineConnent.GetComponent<BaseGameObjInfo>().gameObjID;
//arg.Isconnect = true;
//MessageDispatcher.SendMessage("HOSE_CONNECT_OR_DELECT", arg);
//出水同步
SpraySyncData spraysync = new SpraySyncData();
spraysync.SendUserID = CurrentUserInfo.mySelf.Id;
@ -783,7 +795,7 @@ public class FireManSkillPanelController : MonoBehaviour
SelectFireMan.GetComponent<FireManControl>().SetLay(value);
SelectFireMan.GetComponent<FireManControl>().DestoryPartical();
//这里面判断了能否寻路
SelectFireMan.GetComponent<LayWaterHose>().EndLay();
SelectFireMan.GetComponent<LayWaterHose>().EndLay(false,false);
//SelectFireMan.GetComponent<FireManControl>().ParticleSize = 0;
//SelectFireMan.GetComponent<FireManControl>().SelectParticleType = SprayParticleType.WaterStraight;
if (SelectFireMan.GetComponent<FireManControl>().Flow!=0)
@ -926,6 +938,7 @@ public class FireManSkillPanelController : MonoBehaviour
LayWaterHoseToggle.transform.Find("Label").GetComponent<Text>().text = "铺设水带";
SelectFireMan.GetComponent<LayWaterHose>().EndLay();
SelectFireMan.GetComponent<FireManControl>().workType = FireManSkills.None;
LayerWaterHoseSyncData syncarg = new LayerWaterHoseSyncData();
syncarg.SendUserID = CurrentUserInfo.mySelf.Id;

Loading…
Cancel
Save