From 1501119b12774dfeb2d8efa5853690bc08c601bb Mon Sep 17 00:00:00 2001 From: "DESKTOP-KFV16CV\\cyt" <2268162076@qq.com> Date: Tue, 2 Feb 2021 14:43:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=8D=97=E5=9F=8E=E5=B9=BF?= =?UTF-8?q?=E5=9C=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Equip/Bag/Bag.cs | 35 ++++++++++++++++ .../Scripts/GameObjectSelect/ObjSelectCtrl.cs | 39 +++++++++++++++++- .../Power/FiremanSkill/FireManSkillsPanel.cs | 19 ++++++++- .../FiremanSkill/XiaoFangYuanDrawLine.cs | 8 ++++ Assets/Scripts/Power/Task/ControlSprayHead.cs | 12 ++++++ ProjectSettings/QualitySettings.asset | Bin 4948 -> 4272 bytes 6 files changed, 110 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Equip/Bag/Bag.cs b/Assets/Scripts/Equip/Bag/Bag.cs index 2600f01..70205c5 100644 --- a/Assets/Scripts/Equip/Bag/Bag.cs +++ b/Assets/Scripts/Equip/Bag/Bag.cs @@ -46,6 +46,41 @@ public class Bag : MonoBehaviour { EquipList = data.equips; ChangeCloth(); + var work = GetComponent().workType; + + if (work == FireManSkills.LayWaterHose || work == FireManSkills.SprayFoam || + work == FireManSkills.SprayWater || work == FireManSkills.Decontamination) + { + for (int i = 0; i < data.equips.Count; i++) + { + if (data.equips[i].Name == "消防高压水带") + { + drawLine.BeginLineNum += data.equips[i].Number; + if (!GetComponent().enabled) + { + GetComponent().enabled = true; + GetComponent().enabled = true; + } + if (GetComponent()) + { + // if (GetComponent() == null) + GetComponent().setLine(); + } + } + } + + } + else if (work == FireManSkills.LayLifeSavingFlarePath) + { + for (int i = 0; i < data.equips.Count; i++) + { + if (data.equips[i].Name == "救生照明线") + { + drawLine.BeginLiftLineNum += data.equips[i].Number; + } + } + + } } } } diff --git a/Assets/Scripts/GameObjectSelect/ObjSelectCtrl.cs b/Assets/Scripts/GameObjectSelect/ObjSelectCtrl.cs index 94f571d..22db58d 100644 --- a/Assets/Scripts/GameObjectSelect/ObjSelectCtrl.cs +++ b/Assets/Scripts/GameObjectSelect/ObjSelectCtrl.cs @@ -65,6 +65,25 @@ public class ObjSelectCtrl : MonoBehaviour if (hitObj == gameObject) { + if (SelectedObjs.selectedCharacters.Count>0) + { + if (gameObject != SelectedObjs.selectedCharacters[0]) + { + if(FireManSkillsPanel.GetInstance.gameObject.activeInHierarchy) + {//目前是单选消防员状态 + if (SelectedObjs.selectedCharacters[0].GetComponent().workType == FireManSkills.SprayWater) + { + if (!SelectedObjs.selectedCharacters[0].GetComponentInChildren()) + {//单选的是消防员但是没有出水 + //点击出水按钮但是没有选择出水类型导致 + SelectedObjs.selectedCharacters[0].GetComponent().workType = FireManSkills.None; + } + } + } + + } + } + clearSelection(); if (hitObj.tag != "Player") @@ -87,8 +106,25 @@ public class ObjSelectCtrl : MonoBehaviour private void EscCancelSelected(IMessage obj) { - if (SelectedObjs.selectedObj == gameObject || SelectedObjs.selectedCharacters.Contains(gameObject)) + if (SelectedObjs.selectedObj == gameObject || SelectedObjs.selectedCharacters.Contains(gameObject)) + { + if (SelectedObjs.selectedCharacters.Count > 0) + {//目前是单选消防员状态 + //if (FireManSkillsPanel.GetInstance.gameObject.activeInHierarchy) + { + if (SelectedObjs.selectedCharacters[0].GetComponent().workType == FireManSkills.SprayWater) + {//当前是出水技能但是没有水粒子 + if (!SelectedObjs.selectedCharacters[0].GetComponentInChildren()) + { + SelectedObjs.selectedCharacters[0].GetComponent().workType = FireManSkills.None; + } + } + + } + } clearSelection(); + } + } private void CancelObjSelected(IMessage obj) @@ -163,7 +199,6 @@ public class ObjSelectCtrl : MonoBehaviour DoDisSelect(SelectedObjs.selectedObj); SelectedObjs.selectedObj = null; } - for (int i = SelectedObjs.selectedCharacters.Count - 1; i >= 0; i--) { DoDisSelect(SelectedObjs.selectedCharacters[i]); diff --git a/Assets/Scripts/Power/FiremanSkill/FireManSkillsPanel.cs b/Assets/Scripts/Power/FiremanSkill/FireManSkillsPanel.cs index dc0e32e..007da89 100644 --- a/Assets/Scripts/Power/FiremanSkill/FireManSkillsPanel.cs +++ b/Assets/Scripts/Power/FiremanSkill/FireManSkillsPanel.cs @@ -54,6 +54,22 @@ public class FireManSkillsPanel : ResourceLoadPanel layerwaterHose = panel.Find("LayWaterHose").GetComponent(); layliftSavingFlarePath = panel.Find("LayLifeSavingFlarePath").GetComponent(); } + public void CloseSprayToggle() + { + //if (!chooseObj.GetComponentInChildren()) + //{ + // if (chooseObj.GetComponent().workType == FireManSkills.SprayWater) + // { + // chooseObj.GetComponent().workType = FireManSkills.None; + // } + //} + sprayWater.isOn = false; + + } + public bool GetSprayOn() + { + return sprayWater.isOn; + } public void CloselayhoseToggle() { layerwaterHose.isOn = false; @@ -248,7 +264,7 @@ public class FireManSkillsPanel : ResourceLoadPanel /// void SetToggle() { - if (this==null) + if (this == null) { return; } @@ -280,6 +296,7 @@ public class FireManSkillsPanel : ResourceLoadPanel } } + void SetHasWater(GameObject gameObject) { if (this==null) diff --git a/Assets/Scripts/Power/FiremanSkill/XiaoFangYuanDrawLine.cs b/Assets/Scripts/Power/FiremanSkill/XiaoFangYuanDrawLine.cs index 91a4c2c..f5a20fb 100644 --- a/Assets/Scripts/Power/FiremanSkill/XiaoFangYuanDrawLine.cs +++ b/Assets/Scripts/Power/FiremanSkill/XiaoFangYuanDrawLine.cs @@ -143,6 +143,10 @@ public class XiaoFangYuanDrawLine : MonoBehaviour { if (nowpath != null) { + if (nowpath.Length<1) + { + return; + } if (Allpath.Count == 0) { Allpath.Add(nowpath[0]); @@ -601,6 +605,10 @@ public class XiaoFangYuanDrawLine : MonoBehaviour float disZhaoMingXian = 0.0f;//照明线长 dis += getDrawLine(); + if (Line == null) + { + return; + } if (Line.name.Equals(Guanxian.name)) { disLine = dis; diff --git a/Assets/Scripts/Power/Task/ControlSprayHead.cs b/Assets/Scripts/Power/Task/ControlSprayHead.cs index 81e9acf..2bcd652 100644 --- a/Assets/Scripts/Power/Task/ControlSprayHead.cs +++ b/Assets/Scripts/Power/Task/ControlSprayHead.cs @@ -322,6 +322,18 @@ public class ControlSprayHead : MonoBehaviour if (water) { var particletype = ((ParticleTypeCmdArgs)obj.Data); + if (particletype.ParticleType==ParticleEnum.None) + { + Debug.Log("没有设置水类型"); + if(SelectedObjs.selectedCharacters.Count>0) + { + if (FireManSkillsPanel.GetInstance.gameObject.activeInHierarchy) + { + FireManSkillsPanel.GetInstance.CloseSprayToggle(); + } + } + return; + } IsSpray = true; if (particleenum != particletype.ParticleType) { diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset index e88f0f5728105a10cb35830fd701414c47117ee1..550c6d18e7f0d8a2fec80b32e46729ec2023ffcc 100644 GIT binary patch delta 34 qcmcbjwn34Dfq~PMfk9xyMh*i`#toYtIS;c<4&dZrWSqQKXgL6vr3o$o delta 660 zcmdm>ctwqafq~PMfk8NABZmPeQwZ~BN6zDHJ`4;DtU$~L#Oy%qmRMYpT3iBTApj$g z3Bn8v1&$014i2kVt+MOv=&(I|#>ejcyLWaV8L*nkj-0}|vu4f&i$JxwFfcKI5Ca1X z7=hV9CRDn?9x4U48N`MGgsls3+R6m9QM~@_nKL+T6aX3rvK`$Bs- zOO&lhYJtppFc+lJ*w`5C9c*5A0Lo)?2*_dX`S~dzIS__90K{fsP;g?v65t>;5P6V# zi2Xno5P&s7!W5e$Kw=<`=%K+06mv>VEG@}QE6oA2nSmIj4ulbw^*AwLbIfE<0a^V6 PI6V%s48zXJoC3=Mp*&gK