/// <summary> /// 删除 /// </summary> public void Delete() { print("删除"); bool isPlayt = LocationHistoryUITool.GetIsPlaying(); if (isPlayt) { UGUIMessageBox.Show("是否终止当前人员历史轨迹演示,并删除该人员?", "是", "否", () => { ////如果在播放就让它终止 //ExecuteEvents.Execute<IPointerClickHandler>(MultHistoryPlayUI.Instance.StopBtn.gameObject, new PointerEventData(EventSystem.current), ExecuteEvents.pointerClickHandler); //MultHistoryPlayUI.Instance.RemovePerson(personnel); LocationHistoryUITool.StopPlay(personnel); }, null, null); } else { //MultHistoryPlayUI.Instance.RemovePerson(personnel); //ExecuteEvents.Execute<IPointerClickHandler>(MultHistoryPlayUI.Instance.StopBtn.gameObject, new PointerEventData(EventSystem.current), ExecuteEvents.pointerClickHandler); LocationHistoryUITool.StopPlay(personnel); } }
protected override void Update() { //if (MultHistoryPlayUINew.Instance.istest) //{ // int i= 0; //} base.Update(); if (MultHistoryPlayUINew.Instance.isPlay) { if (!isCreatePathComplete) { return; } if (!LocationHistoryUITool.GetIsPlaying()) { return; } if (isNeedHide) { isNeedHide = false; Hide(); return; } float valuet = 1; valuet = LocationHistoryUITool.GetProcessSliderValue(); if (valuet < 1) { //double timesum = MultHistoryPlayUI.Instance.timeSum; //DateTime showPointTime = MultHistoryPlayUI.Instance.GetStartTime().AddSeconds(timesum); MultHistoryTimeStamp timeStamp = LocationHistoryUITool.GetTimeStamp(); double timesum = timeStamp.timeSum; DateTime showPointTime = timeStamp.showPointTime; float currentSpeedT = timeStamp.currentSpeed; if (currentPointIndex < PosCount && currentPointIndex > -1) { //Debug.LogErrorFormat("timelist[currentPointIndex]:{0},showPointTime:{1}", timelist[currentPointIndex], showPointTime); if (PosInfoList[currentPointIndex].Time < showPointTime) { //double timesum2 = (timelist[currentPointIndex] - HistoryPlayUI.Instance.GetStartTime()).TotalSeconds; //Debug.Log("timesum2:" + timesum2); //progressTargetValue = (double)timesum2 / HistoryPlayUI.Instance.timeLength; //if (MultHistoryPlayUI.Instance.isNewWalkPath) //{ if (currentPointIndex - 1 >= 0) { double temp = PosInfoList.GetTimeSpane(currentPointIndex); if (temp > 2f) { //ExcuteHistoryPath(currentPointIndex,1f, false); ExcuteHistoryPath(currentPointIndex, currentSpeedT); currentPointIndex++; return; } else { ExcuteHistoryPath(currentPointIndex, currentSpeedT); } } else { ExcuteHistoryPath(currentPointIndex, currentSpeedT); } //} //else //{ // ExcuteHistoryPath(currentPointIndex, MultHistoryPlayUI.Instance.CurrentSpeed); //} //Debug.LogError("currentPointIndex111:" + currentPointIndex); currentPointIndex++; Show(); } else//如果当前点的时间超过了当前进度时间 { //if (currentPointIndex - 1 >= 0) //{ // ExcuteHistoryPath(currentPointIndex - 1, MultHistoryPlayUI.Instance.CurrentSpeed); //} ExcuteHistoryPath(currentPointIndex, currentSpeedT); //Debug.LogError("currentPointIndex222:" + currentPointIndex); //if (MultHistoryPlayUI.Instance.isNewWalkPath) //{ if (currentPointIndex - 1 >= 0) { double temp = (PosInfoList[currentPointIndex].Time - PosInfoList[currentPointIndex - 1].Time).TotalSeconds; if (temp > 2f)//如果当前要执行历史点的值,超过播放时间值5秒,就认为这超过5秒时间里,没历史轨迹数据,则让人员消失 { //Hide(); } } else { //Hide(); } //} //else //{ // double temp = (timelist[currentPointIndex] - showPointTime).TotalSeconds; // if (temp > 5f)//如果当前要执行历史点的值,超过播放时间值5秒,就认为这超过5秒时间里,没历史轨迹数据,则让人员消失 // { // Hide(); // } //} } //progressValue = Mathf.Lerp((float)progressValue, (float)progressTargetValue, 2 * Time.deltaTime); //transform.position = line.GetPoint3D01((float)progressValue); //ExcuteHistoryPath(currentPointIndex); } else { Hide(); } } else { progressValue = 0; progressTargetValue = 0; currentPointIndex = 0; } } //else //{ ShowArea(); //} if (depnode != null) { if (LocationHistoryManager.Instance && LocationHistoryManager.Instance.IsFocus)//对焦状态时才可以加载设备 { BuildingController buillding = depnode.GetParentNode <BuildingController>(); if (buillding && !buillding.IsDevCreate)//加载设备 { buillding.IsDevCreate = true; buillding.LoadDevices(() => { RoomFactory.Instance.CreateDepDev(buillding, true);//todo:是否可以不加载动态设备 }); } } } }