using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class PoliceCallMessageBind : MonoBehaviour { [Rename("报警人")] public Text PoliceCallName; [Rename("着火点地点")] public Text FirePlace; [Rename("着火原因")] public Text FireReason; [Rename("危险等级")] public Text FireLevel; [Rename("是否有危险品或者爆炸物")] public Text HasDangerous; [Rename("电话")] public Text Phone; [Rename("着火面积")] public Text FireArea; [Rename("被困人员")] public Text HasTrapped; public GameObject CallPanel; public GameObject CarTransferPanel; public ButtonRecordByAC CallBtn; public ButtonRecordByAC CarTransferBtn; void Awake() { if (GameSettings.disasterSetting.policeCallData != null) BindPoliceCallData(GameSettings.disasterSetting.policeCallData); } void Start() { CallBtn.OutInterFaceButton = CallBtnClick; CarTransferBtn.OutInterFaceButton = CarTransferBtnClick; } private void CarTransferBtnClick() { if (!CarTransferPanel.gameObject.activeSelf) CarTransferPanel.gameObject.SetActive(true); } private void CallBtnClick() { if (!CallPanel.gameObject.activeSelf) CallPanel.gameObject.SetActive(true); } //用来绑定报警人信息的方法 public void BindPoliceCallData(PoliceCallData data) { PoliceCallName.text = data.Name; Phone.text = data.Phone; FirePlace.text = data.FirePlace; FireReason.text = data.FireReason; FireArea.text = data.FirePlace; FireLevel.text = data.FireLevel; HasTrapped.text = data.HasTrapped; HasDangerous.text = data.HasDangerous; } }