using AX.MessageSystem; using AX.NetworkSystem; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class PoliceCallPanel : MonoBehaviour { public Transform PoliceCloseButton; public Transform CallMan; public Transform Phone; public Transform FirePlace; public Transform FireArea; public Transform FireReason; public Transform Trapped; public Transform FireLeave; public Transform Dangerous; public Transform PoliceCallButton; public Transform PoliceCallCancelButton; public Transform ArriveTimeTitle; public string callname; public string phone; public string firePlace; public string fireReason; public string fireArea; public string fireLevel; public string hasDangerous; public string hasTrapped; private string errortext; private Transform P_FireLiquidLevel; private Transform dis; private void Awake() { dis = GameObject.Find("P_AllParent").transform.Find("P_Disasters"); MessageDispatcher.AddListener("LOAD_UIDISASTER", LoadUIDisaster); this.gameObject.SetActive(false); P_FireLiquidLevel = GameObject.Find("P_FireLiquidLevel").transform; } // Use this for initialization void Start() { PoliceCloseButton.GetComponent().OutInterFaceButton = PoliceCloseButtonClick; CallMan.GetComponent().OutInterFaceInPutField = CallManOnValueChange; Phone.GetComponent().OutInterFaceInPutField = PhoneOnValueChange; FirePlace.GetComponent().OutInterFaceInPutField = FirePlaceOnValueChange; FireArea.GetComponent().OutInterFaceInPutField = FireAreaOnValueChange; FireReason.GetComponent().OutInterFaceInPutField = FireReasonOnValueChange; FireLeave.GetComponent().OutInterFaceDropDown = FireLeaveOnValueChange; Dangerous.GetComponent().OutInterFaceInPutField = DangerousOnValueChange; PoliceCallButton.GetComponent().OutInterFaceButton = PoliceCallButtonClick; PoliceCallCancelButton.GetComponent().OutInterFaceButton = PoliceCallCancelOnClick; fireReason = "不详"; fireArea = "不详"; hasDangerous = "不详"; fireLevel = "不详"; } public void OnEnable() { int trap_wound = dis.Find("P_TrappedPerson").childCount + dis.Find("P_Wounded").childCount; Trapped.GetComponent().text = trap_wound > 0 ? "是" : "否"; } private void OnDestroy() { MessageDispatcher.RemoveListener("LOAD_UIDISASTER", LoadUIDisaster); } private void LoadUIDisaster(IMessage obj) { if (GameSettings.othersSettings.isSelectedDisaster) { DataBind(); if (GameSettings.othersSettings.mode != Mode.DisasterManagement) {//若是练习或演习模式进入导调组界面,则不可以修改 CallMan.GetComponent().interactable = false; Phone.GetComponent().interactable = false; FirePlace.GetComponent().interactable = false; FireArea.GetComponent().interactable = false; FireReason.GetComponent().interactable = false; FireLeave.GetComponent().interactable = false; Dangerous.GetComponent().interactable = false; } else { if (!GameSettings.disasterSetting.isEdit) {//若是灾情库设置模式的查看,则不可以修改 CallMan.GetComponent().interactable = false; Phone.GetComponent().interactable = false; FirePlace.GetComponent().interactable = false; FireArea.GetComponent().interactable = false; FireReason.GetComponent().interactable = false; FireLeave.GetComponent().interactable = false; Dangerous.GetComponent().interactable = false; PoliceCallButton.GetComponent