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.
140 lines
5.7 KiB
140 lines
5.7 KiB
using UnityEngine; |
|
using System.Collections; |
|
using UnityEngine.EventSystems; |
|
using AX.TrackRecord; |
|
using AX.MessageSystem; |
|
using System; |
|
using Video; |
|
/// <summary> |
|
/// 伤员响应事件 |
|
/// </summary> |
|
public class WoundedControl : MonoBehaviour { |
|
public static WoundedControl Instance; |
|
private GameObject TipWindow; |
|
[HideInInspector] |
|
public bool isfage=false; |
|
public bool havefinished = false; |
|
private DateTime t1, t2; |
|
void Awake() |
|
{ |
|
if (Instance == null) |
|
{ |
|
Instance = this; |
|
} |
|
} |
|
void OnMouseDown() |
|
{ |
|
t2 = DateTime.Now; |
|
if (t2 - t1 < new TimeSpan(0, 0, 0, 0, 400) && !EventSystem.current.IsPointerOverGameObject() && !LoadManager.Instance.IsPlayBacking) |
|
{ |
|
|
|
if (!isfage && !havefinished) |
|
{ |
|
if (ExamInfoHelpClass.loadSceneMode == ExamInfoHelpClass.LoadSceneMode.PrepareMode |
|
|| ExamInfoHelpClass.loadSceneMode == ExamInfoHelpClass.LoadSceneMode.EditCourceware || |
|
ExamInfoHelpClass.loadSceneMode == ExamInfoHelpClass.LoadSceneMode.SelfStudyMode || |
|
ExamInfoHelpClass.loadSceneMode == ExamInfoHelpClass.LoadSceneMode.ExamineMode) |
|
{ |
|
if (ExamInfoHelpClass.applicationMode == ExamInfoHelpClass.ApplicationMode.SANDTABLE) |
|
{ |
|
if (RecordManager.Instance.IsRecording |
|
|| (!RecordManager.Instance.IsRecording && !LoadManager.Instance.IsPlayBacking)) |
|
{ |
|
MessageDispatcher.SendMessage("SHOW_YINGJIU", gameObject); |
|
//TipWindow = Instantiate(Resources.Load<GameObject>("UIPrefab/TipWindow")); |
|
//string tip = "确定营救被困人员?"; |
|
//if (gameObject.name.Contains("sy1")) |
|
//{ |
|
// tip = "确定营救伤员?"; |
|
//} |
|
//TipWindow.GetComponent<TipWindowManager>().SetWindow( |
|
// tip, new UnityEngine.Events.UnityAction(OKSubmit), new UnityEngine.Events.UnityAction(NOSubmit)); |
|
|
|
//isfage = true; |
|
} |
|
} |
|
else |
|
{ |
|
|
|
|
|
if (ExamInfoHelpClass.loadSceneMode != ExamInfoHelpClass.LoadSceneMode.CreatQuestion |
|
&& ExamInfoHelpClass.loadSceneMode != ExamInfoHelpClass.LoadSceneMode.EditQuestion |
|
&& ExamInfoHelpClass.loadSceneMode != ExamInfoHelpClass.LoadSceneMode.CopyQuestion) |
|
{ |
|
bool Has = false; |
|
foreach (Transform child in GameObject.Find("pxiaofangyuan").transform) |
|
{ |
|
float distance = Vector3.Distance(child.transform.position, |
|
this.gameObject.transform.position); |
|
if (distance < 4f) |
|
{ |
|
Has = true; |
|
if (RecordManager.Instance.IsRecording |
|
|| (!RecordManager.Instance.IsRecording && !LoadManager.Instance.IsPlayBacking)) |
|
{ |
|
MessageDispatcher.SendMessage("SHOW_YINGJIU", gameObject); |
|
//TipWindow = Instantiate(Resources.Load<GameObject>("UIPrefab/TipWindow")); |
|
//string tip = "确定营救被困人员?"; |
|
//if (gameObject.name.Contains("sy1")) |
|
//{ |
|
// tip = "确定营救伤员?"; |
|
//} |
|
//TipWindow.GetComponent<TipWindowManager>().SetWindow( |
|
// tip, new UnityEngine.Events.UnityAction(OKSubmit), new UnityEngine.Events.UnityAction(NOSubmit)); |
|
|
|
//isfage = true; |
|
} |
|
|
|
break; |
|
} |
|
} |
|
if (!Has) |
|
{ |
|
MessageDispatcher.SendMessage("Operatinghints", (object)"请消防员靠近被困人员"); |
|
} |
|
} |
|
} |
|
} |
|
|
|
|
|
} |
|
|
|
} |
|
t1 = t2; |
|
|
|
} |
|
/* |
|
private void OKSubmit() |
|
{ |
|
isfage = false; |
|
if (LineamentEvent.gameobj==null) |
|
{ |
|
return; |
|
} |
|
string pName = TrackRecordHelpClass.GetParentName(LineamentEvent.gameobj.name); |
|
MessageDispatcher.SendMessage(pName, "DestroyObj", (object)this.name); |
|
PlayVideo(); |
|
} |
|
|
|
public void PlayVideo() |
|
{ |
|
int rnd = new System.Random().Next(2); |
|
string mov = rnd == 0 ? "背.mov" : "跟随跑.mov"; |
|
VCR._videoFiles = ExamInfoHelpClass.VideoFilePath + mov; |
|
|
|
VCR.Instance().StartPlayer(); |
|
if (LoadManager.Instance.IsPlayBacking) |
|
{ |
|
//VCR._mediaPlayer.m_PlaybackRate = LoadManager.Instance.LoadSpeed; |
|
VCR._mediaPlayer.Control.SetPlaybackRate(LoadManager.Instance.LoadSpeed); |
|
} |
|
GameObject.Find("Canvas").transform.Find("Panel_Video 1").GetComponent<RectTransform>().localScale = new Vector3(0.5f, 0.5f, 1); |
|
|
|
} |
|
|
|
public void NOSubmit() |
|
{ |
|
isfage = false; |
|
} |
|
*/ |
|
}
|
|
|