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()) {//作战部署消防力量(消防车,消防员) InputManager.selectedFireDeployObjId = transform.parent.GetComponent().gameObjID; } else if (transform.GetComponent()) {//分类私有工具:外部力量布置,内部力量部署,供水等;公用工具:箭头 InputManager.selectedFireDeployObjId = transform.GetComponent().gameObjID; } } else { InputManager.selectedFireDeployObjId = -1; } } private void Update() { //控制不是总指挥后,消防力量:消防车,消防员;分类私有工具:外部力量布置,内部力量部署,供水等;公用工具:箭头; //这些对象不能选中,从而控制不是总指挥后也不能删除 if (!CurrentUserInfo.generalCommanding) { transform.GetComponent().isOn = false;//若之前是选中情况,不是总指挥后,取消选中 transform.GetComponent().interactable = false; //控制不是总指挥情况下,不能操作拖动 if (transform.parent.GetComponent()) { transform.parent.GetComponent().enabled = false; } else { if (transform.GetComponent()) { transform.GetComponent().enabled = false; } } } else { transform.GetComponent().interactable = true; if (transform.parent.GetComponent()) { transform.parent.GetComponent().enabled = true; } else { if (transform.GetComponent()) { transform.GetComponent().enabled = true; } } } } }