Browse Source

同步南城广场修改

master
曹衍涛 4 years ago
parent
commit
1501119b12
  1. 35
      Assets/Scripts/Equip/Bag/Bag.cs
  2. 39
      Assets/Scripts/GameObjectSelect/ObjSelectCtrl.cs
  3. 19
      Assets/Scripts/Power/FiremanSkill/FireManSkillsPanel.cs
  4. 8
      Assets/Scripts/Power/FiremanSkill/XiaoFangYuanDrawLine.cs
  5. 12
      Assets/Scripts/Power/Task/ControlSprayHead.cs
  6. BIN
      ProjectSettings/QualitySettings.asset

35
Assets/Scripts/Equip/Bag/Bag.cs

@ -46,6 +46,41 @@ public class Bag : MonoBehaviour
{
EquipList = data.equips;
ChangeCloth();
var work = GetComponent<FireManMessage>().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<NavMeshAgent>().enabled)
{
GetComponent<NavMeshAgent>().enabled = true;
GetComponent<AgentController>().enabled = true;
}
if (GetComponent<XiaoFangYuanDrawLine>())
{
// if (GetComponent<XiaoFangYuanDrawLine>() == null)
GetComponent<XiaoFangYuanDrawLine>().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;
}
}
}
}
}
}

39
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<FireManMessage>().workType == FireManSkills.SprayWater)
{
if (!SelectedObjs.selectedCharacters[0].GetComponentInChildren<ParticleControlOfType>())
{//单选的是消防员但是没有出水
//点击出水按钮但是没有选择出水类型导致
SelectedObjs.selectedCharacters[0].GetComponent<FireManMessage>().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<FireManMessage>().workType == FireManSkills.SprayWater)
{//当前是出水技能但是没有水粒子
if (!SelectedObjs.selectedCharacters[0].GetComponentInChildren<ParticleControlOfType>())
{
SelectedObjs.selectedCharacters[0].GetComponent<FireManMessage>().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]);

19
Assets/Scripts/Power/FiremanSkill/FireManSkillsPanel.cs

@ -54,6 +54,22 @@ public class FireManSkillsPanel : ResourceLoadPanel<FireManSkillsPanel>
layerwaterHose = panel.Find("LayWaterHose").GetComponent<Toggle>();
layliftSavingFlarePath = panel.Find("LayLifeSavingFlarePath").GetComponent<Toggle>();
}
public void CloseSprayToggle()
{
//if (!chooseObj.GetComponentInChildren<ParticleControlOfType>())
//{
// if (chooseObj.GetComponent<FireManMessage>().workType == FireManSkills.SprayWater)
// {
// chooseObj.GetComponent<FireManMessage>().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<FireManSkillsPanel>
/// </summary>
void SetToggle()
{
if (this==null)
if (this == null)
{
return;
}
@ -280,6 +296,7 @@ public class FireManSkillsPanel : ResourceLoadPanel<FireManSkillsPanel>
}
}
void SetHasWater(GameObject gameObject)
{
if (this==null)

8
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;

12
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)
{

BIN
ProjectSettings/QualitySettings.asset

Binary file not shown.
Loading…
Cancel
Save