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.
72 lines
2.3 KiB
72 lines
2.3 KiB
4 years ago
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
public class WaterCurtainHoseSkillPanelController : MonoBehaviour {
|
||
|
|
||
|
[Rename("出水")]
|
||
|
public ToggleRecordByAC SprayWater;
|
||
|
public GameObject SelectWaterCurtainHose;
|
||
|
// private LayWaterPanel laywaterpanel;
|
||
|
private static WaterCurtainHoseSkillPanelController instance;
|
||
|
|
||
|
public static WaterCurtainHoseSkillPanelController Instance
|
||
|
{
|
||
|
get
|
||
|
{
|
||
|
return instance;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Use this for initialization
|
||
|
void Start()
|
||
|
{
|
||
|
instance = this;
|
||
|
//laywaterpanel = GetComponent<LayWaterPanel>();
|
||
|
SprayWater.OutInterFaceToggle = SprayToggleChange;
|
||
|
}
|
||
|
public void SetWaterCurtainHosen(GameObject select)
|
||
|
{
|
||
|
SelectWaterCurtainHose = select;
|
||
|
|
||
|
if (select.GetComponent<WaterCurtainHoseSkillCtrl>().waterSourceGameObjId != -1)
|
||
|
{//绑定了水源,选中水幕水带时,才会启用出水技能按钮
|
||
|
SprayWater.GetComponent<Toggle>().interactable = true;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
SprayWater.GetComponent<Toggle>().interactable = false;
|
||
|
}
|
||
|
|
||
|
//Todo,根据水幕水带脚本信息设置显示
|
||
|
if (SelectWaterCurtainHose.GetComponent<WaterCurtainHoseSkillCtrl>().waterCurtainHoseSkill.SprayWater.Active)
|
||
|
{
|
||
|
SprayWater.GetComponent<Toggle>().isOn = true;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
SprayWater.GetComponent<Toggle>().isOn = false;
|
||
|
}
|
||
|
}
|
||
|
private void SprayToggleChange(bool value)
|
||
|
{
|
||
|
SprayWater.transform.Find("IconClose").gameObject.SetActive(value);
|
||
|
SprayWater.transform.Find("IconOpen").gameObject.SetActive(!value);
|
||
|
Debug.Log(value ? "水幕水带开" : "水幕水带关");
|
||
|
|
||
|
//TODO:控制水幕水带出水或停止出水
|
||
|
SelectWaterCurtainHose.GetComponent<WaterCurtainHoseSkillCtrl>().waterCurtainHoseSkill.SprayWater.Active = value;//设置水幕水带出水技能状态
|
||
|
|
||
|
if (value)
|
||
|
{//出水
|
||
|
SelectWaterCurtainHose.GetComponent<WaterCurtainHoseSkillCtrl>().SprayWaterCurtain(SelectWaterCurtainHose);
|
||
|
}
|
||
|
else
|
||
|
{//停止出水
|
||
|
SelectWaterCurtainHose.GetComponent<WaterCurtainHoseSkillCtrl>().StopWaterCurtain(SelectWaterCurtainHose);
|
||
|
}
|
||
|
}
|
||
|
}
|