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.
131 lines
3.8 KiB
131 lines
3.8 KiB
using System; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using UnityEngine.UI; |
|
|
|
[Serializable] |
|
public class ZhiQingRenData |
|
{ |
|
//public string name; |
|
public bool zhy; |
|
public bool wz; |
|
public bool bkry; |
|
public bool zdwxy; |
|
public bool snxfss; |
|
public bool jznbjg; |
|
public string other; |
|
public string answer; |
|
} |
|
public class ZhiQingRenPanel : ResourceLoadPanel<ZhiQingRenPanel> |
|
{ |
|
public Toggle ZHY; |
|
public Toggle WZ; |
|
public Toggle BKRY; |
|
public Toggle ZDWXY; |
|
public Toggle SNXFSS; |
|
public Toggle JZNBJG; |
|
public InputField QuestionInput; |
|
public Button CloseBtn; |
|
public Button SureBtn; |
|
private string answer; |
|
void Start() |
|
{ |
|
CloseBtn.onClick.AddListener(CloseBtn_Click); |
|
SureBtn.onClick.AddListener(SureBtn_Click); |
|
} |
|
|
|
private void CloseBtn_Click() |
|
{ |
|
gameObject.SetActive(false); |
|
} |
|
public void AddRecordEventAskZhiQingRen(ZhiQingRenData data) |
|
{ |
|
if (ReplaySetting.PlayStatus == PlayStatus.isEditor && RecordManager.Instance.recordStatus == RecordStatus.normal) |
|
{ |
|
var eventData = new EventData(); |
|
eventData.time = RecordManager.Instance.RecordTimer; |
|
eventData.cloneObjType = CloneObjType.None; |
|
eventData.eventType = RecordEventType.AskZhiQingRen; |
|
eventData.json = JsonUtility.ToJson(data); |
|
|
|
RecordManager.Instance.jsonData.eventDataList.Add(eventData); |
|
} |
|
} |
|
private void SureBtn_Click() |
|
{ |
|
if (ZHY.isOn) |
|
{ |
|
answer += "<color=red>着火源:</color>不明确 "; |
|
} |
|
if (WZ.isOn) |
|
{ |
|
answer += "<color=red>位置:</color>不明确 "; |
|
} |
|
if (BKRY.isOn) |
|
{ |
|
if (GameObject.Find("P_AllParent").transform.Find("P_Disaster/P_Wounded").childCount > 0 |
|
|| GameObject.Find("P_AllParent").transform.Find("P_Disaster/P_TrappedPerson").childCount > 0) |
|
answer += "有<color=red>被困人员 </color>"; |
|
else |
|
answer += "未发现有<color=red>被困人员 </color>"; |
|
} |
|
if (ZDWXY.isOn) |
|
{ |
|
answer += "<color=red>重大危险源</color>不明确 "; |
|
} |
|
if (SNXFSS.isOn) |
|
{ |
|
answer += "<color=red>室内消防设施情况</color>不明确 "; |
|
} |
|
if (JZNBJG.isOn) |
|
{ |
|
answer += "<color=red>建筑结构内部拆改情况</color>不明确 "; |
|
} |
|
if (!string.IsNullOrEmpty(answer)) |
|
ResourceLoadWindow.Instance.LoadTextHintWindow(answer, 2f); |
|
ZhiQingRenData data = new ZhiQingRenData(); |
|
|
|
data.zhy = ZHY.isOn; |
|
data.wz = WZ.isOn; |
|
data.bkry = BKRY.isOn; |
|
data.zdwxy = ZDWXY.isOn; |
|
data.snxfss = SNXFSS.isOn; |
|
data.jznbjg = JZNBJG.isOn; |
|
data.other = QuestionInput.text; |
|
data.answer = answer; |
|
AddRecordEventAskZhiQingRen(data); |
|
CloseBtn_Click(); |
|
} |
|
public void AskZhiQingRen(ZhiQingRenData data = null) |
|
{ |
|
if (data != null) |
|
{ |
|
ZHY.isOn = data.zhy; |
|
WZ.isOn = data.wz; |
|
BKRY.isOn = data.bkry; |
|
ZDWXY.isOn = data.zdwxy; |
|
SNXFSS.isOn = data.snxfss; |
|
JZNBJG.isOn = data.jznbjg; |
|
QuestionInput.text = data.other; |
|
answer = data.answer; |
|
} |
|
else |
|
{ |
|
if (ZHY.isOn) |
|
ZHY.isOn = false; |
|
if (WZ.isOn) |
|
WZ.isOn = false; |
|
if (BKRY.isOn) |
|
BKRY.isOn = false; |
|
if (ZDWXY.isOn) |
|
ZDWXY.isOn = false; |
|
if (SNXFSS.isOn) |
|
SNXFSS.isOn = false; |
|
if (JZNBJG.isOn) |
|
JZNBJG.isOn = false; |
|
QuestionInput.text = ""; |
|
answer = ""; |
|
} |
|
} |
|
}
|
|
|