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.
68 lines
2.3 KiB
68 lines
2.3 KiB
4 years ago
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
public class FireDeployObjSelect : BaseToggle
|
||
|
{
|
||
|
public override void RespondFun(bool value)
|
||
|
{
|
||
|
if (value)
|
||
|
{
|
||
|
if (transform.parent.GetComponent<BaseGameObjInfo>())
|
||
|
{//作战部署消防力量(消防车,消防员)
|
||
|
InputManager.selectedFireDeployObjId = transform.parent.GetComponent<BaseGameObjInfo>().gameObjID;
|
||
|
}
|
||
|
else if (transform.GetComponent<BaseGameObjInfo>())
|
||
|
{//分类私有工具:外部力量布置,内部力量部署,供水等;公用工具:箭头
|
||
|
InputManager.selectedFireDeployObjId = transform.GetComponent<BaseGameObjInfo>().gameObjID;
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
InputManager.selectedFireDeployObjId = -1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private void Update()
|
||
|
{
|
||
|
//控制不是总指挥后,消防力量:消防车,消防员;分类私有工具:外部力量布置,内部力量部署,供水等;公用工具:箭头;
|
||
|
//这些对象不能选中,从而控制不是总指挥后也不能删除
|
||
|
if (!CurrentUserInfo.generalCommanding)
|
||
|
{
|
||
|
transform.GetComponent<Toggle>().isOn = false;//若之前是选中情况,不是总指挥后,取消选中
|
||
|
transform.GetComponent<Toggle>().interactable = false;
|
||
|
|
||
|
//控制不是总指挥情况下,不能操作拖动
|
||
|
if (transform.parent.GetComponent<OnDragPanel>())
|
||
|
{
|
||
|
transform.parent.GetComponent<OnDragPanel>().enabled = false;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
if (transform.GetComponent<OnDragPanel>())
|
||
|
{
|
||
|
transform.GetComponent<OnDragPanel>().enabled = false;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
transform.GetComponent<Toggle>().interactable = true;
|
||
|
|
||
|
if (transform.parent.GetComponent<OnDragPanel>())
|
||
|
{
|
||
|
transform.parent.GetComponent<OnDragPanel>().enabled = true;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
if (transform.GetComponent<OnDragPanel>())
|
||
|
{
|
||
|
transform.GetComponent<OnDragPanel>().enabled = true;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|