网上演练贵港万达广场(人员密集)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.0 KiB

4 years ago
using AX.MessageSystem;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AssociatedLineCloneButton : BaseToggle
{
private GameObject SelectFireMan;
public CloneObjType cloneObjType;
private Transform p_WaterHose;
void Start()
{
SelectFireMan = FireManSkillPanelController.Instance.SelectFireMan;
p_WaterHose = GameObject.Find("P_AllParent").transform.Find("P_FireSkill/P_WaterHose");
}
public override void OnEnable()
{
base.OnEnable();
}
public override void OnDisable()
{
base.OnDisable();
}
public override void OnDestroy()
{
base.OnDestroy();
}
public override void RespondFun(bool isOn)
{
var group = GetComponent<Toggle>().group;
if (group)
{//因为是排他的选择框,只执行主动改值的事件
var anyIsOn = group.AnyTogglesOn();
if ((anyIsOn && isOn) || (!anyIsOn))
{
if (isOn)
{
InputManager.cloneObjType = cloneObjType;
MessageDispatcher.SendMessage("CloneSelected");//克隆按钮选中,取消技能触发
SelectFireMan.GetComponent<FireManControl>().workType = FireManSkills.AssociatedLine;
}
else
{
if (SelectFireMan.GetComponent<FireManControl>().workType==FireManSkills.AssociatedLine)
{
p_WaterHose.GetComponent<CloneWaterHoseLines>().ResertLine();
}
SelectFireMan.GetComponent<FireManControl>().workType = FireManSkills.None;
InputManager.cloneObjType = CloneObjType.None;
AX.MessageSystem.MessageDispatcher.SendMessage("RESERTLINT");
Debug.Log(111);
}
}
}
}
}