From d5688649ffbb0f558e030eb647f1f7711449c241 Mon Sep 17 00:00:00 2001 From: YDL <1368269699@QQ.COM> Date: Mon, 21 Mar 2022 17:37:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BC=94=E7=BB=83=E7=9B=B8=E5=85=B3=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainScene/FloorControlModule/UIFloor.cs | 18 ++- .../Prefabs/DongYouLiQing/P_AllParent.prefab | 2 +- .../DisasterPrefabs/TrappedPerson.prefab | 16 +-- .../ClonePrefabs/Tool/SafeArea.prefab | 4 +- .../Common/DisasterLibrary/DisasterLoad.cs | 112 +++++++++++++++++- .../Wound_Trapped/TrappedMoveFree.cs | 54 ++++++--- .../Wound_Trapped/TrappedPathFind.cs | 14 ++- .../Common/GameObjectCtrl/ObjRotate.cs | 4 +- .../InputSystem/InputManager/InputManager.cs | 46 ++++++- .../NetWorkSync/OBJ_ROTATE_SYNC.cs | 3 +- .../NetWorkSync/PATHFIND_SYNC.cs | 4 +- .../Scripts/Common/Tools/SafeAreaMessage.cs | 4 +- .../SkillPanel/FireManSkillPanelController.cs | 50 ++++++-- Assets/Scripts/SmartX1/SmartController.cs | 4 +- 14 files changed, 273 insertions(+), 62 deletions(-) diff --git a/Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs b/Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs index f1d0c91..ebeccb3 100644 --- a/Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs +++ b/Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs @@ -96,7 +96,12 @@ public class UIFloor : BaseToggle } foreach (var item in floorsPanelManager.AllWai) { - item.gameObject.SetActive(true); + Renderer[] renderers = item.GetComponentsInChildren(); + for (int i = 0; i < renderers.Length; i++) + { + renderers[i].enabled = true; + } + //item.gameObject.SetActive(true); } ShowCloneObj(); } @@ -109,7 +114,12 @@ public class UIFloor : BaseToggle { if (item.buildNum == data.buildNum && item.floorNum > data.floorNum && Mathf.Abs(item.floorNum) > 0) { - item.gameObject.SetActive(false); + Renderer[] renderers = item.GetComponentsInChildren(); + for (int i = 0; i < renderers.Length; i++) + { + renderers[i].enabled = false; + } + //item.gameObject.SetActive(false); } } @@ -139,7 +149,7 @@ public class UIFloor : BaseToggle } if (MyTarget != null/* && floorNum == 0*/)//镜头拉近 { - cameraManager.SetCameraView(MyTarget.position, FollowCameraDistance,-110,52); + cameraManager.SetCameraView(MyTarget.position, FollowCameraDistance,50,52); } //if (RecordData.isRecording()) //{ @@ -206,7 +216,7 @@ public class UIFloor : BaseToggle { if (objs[i].gameObject == SelectedObjs.selectedObj || SelectedObjs.selectedCharacters.Contains( objs[i].gameObject)) { - break; + continue; } //if (string.IsNullOrEmpty(objs[i].buildNum)) //{//克隆在地面上的物体 diff --git a/Assets/Prefabs/DongYouLiQing/P_AllParent.prefab b/Assets/Prefabs/DongYouLiQing/P_AllParent.prefab index d87e240..154bd7d 100644 --- a/Assets/Prefabs/DongYouLiQing/P_AllParent.prefab +++ b/Assets/Prefabs/DongYouLiQing/P_AllParent.prefab @@ -1197,7 +1197,7 @@ MonoBehaviour: type: 3} cloneObjType: 106 Height: 0.2 - AreaPrefabSize: 20 + AreaPrefabSize: 10 cloneAble: 0 --- !u!114 &114948936895584374 MonoBehaviour: diff --git a/Assets/Resources/ClonePrefabs/DisasterPrefabs/TrappedPerson.prefab b/Assets/Resources/ClonePrefabs/DisasterPrefabs/TrappedPerson.prefab index b593e97..9d2a687 100644 --- a/Assets/Resources/ClonePrefabs/DisasterPrefabs/TrappedPerson.prefab +++ b/Assets/Resources/ClonePrefabs/DisasterPrefabs/TrappedPerson.prefab @@ -1047,16 +1047,16 @@ NavMeshAgent: m_GameObject: {fileID: 1827870700707724} m_Enabled: 1 m_AgentTypeID: 0 - m_Radius: 0.5 + m_Radius: 0.1 m_Speed: 2.5 - m_Acceleration: 8 + m_Acceleration: 80 avoidancePriority: 50 - m_AngularSpeed: 120 - m_StoppingDistance: 1.5 + m_AngularSpeed: 400 + m_StoppingDistance: 0.5 m_AutoTraverseOffMeshLink: 1 m_AutoBraking: 1 m_AutoRepath: 1 - m_Height: 2 + m_Height: 1.5 m_BaseOffset: 0 m_WalkableMask: 4294967295 m_ObstacleAvoidanceType: 4 @@ -1254,13 +1254,13 @@ CharacterController: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Height: 2 - m_Radius: 0.3 + m_Height: 1.89 + m_Radius: 0.26 m_SlopeLimit: 45 m_StepOffset: 0.3 m_SkinWidth: 0.08 m_MinMoveDistance: 0.001 - m_Center: {x: 0, y: 1, z: 0} + m_Center: {x: 0, y: 0.92, z: 0} --- !u!114 &2594175076028504782 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Resources/ClonePrefabs/Tool/SafeArea.prefab b/Assets/Resources/ClonePrefabs/Tool/SafeArea.prefab index f8a35c3..8c0b34c 100644 --- a/Assets/Resources/ClonePrefabs/Tool/SafeArea.prefab +++ b/Assets/Resources/ClonePrefabs/Tool/SafeArea.prefab @@ -40,7 +40,7 @@ Transform: m_GameObject: {fileID: 1688105851940198} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -569.1, y: 0.3, z: -480.8} - m_LocalScale: {x: 1.5, y: 1, z: 1.5} + m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 @@ -187,7 +187,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: a2cecff9aa0169343bb23ed89a955a6c, type: 3} m_Name: m_EditorClassIdentifier: - sideLength: 20 + sideLength: 10 hasWounderNum: 0 --- !u!114 &114330804224454362 MonoBehaviour: diff --git a/Assets/Scripts/Common/DisasterLibrary/DisasterLoad.cs b/Assets/Scripts/Common/DisasterLibrary/DisasterLoad.cs index c55d0f2..9563b70 100644 --- a/Assets/Scripts/Common/DisasterLibrary/DisasterLoad.cs +++ b/Assets/Scripts/Common/DisasterLibrary/DisasterLoad.cs @@ -269,6 +269,17 @@ public class DisasterLoad : MonoBehaviour clonesync.gameObjType = cloneGameObjInfo.gameObjType; clonesync.UserID = cloneGameObjInfo.UserID; NetworkManager.Default.SendAsync("CLONE_SINGLE_DISASTER_SYNC", clonesync); + + //旋转同步,加载灾情导掉足同步克隆只同步了位置,没有同步旋转,所以要在同步一遍旋转 + if (obj.GetComponent()) + { + var arg = new ObjRotateSyncData(); + arg.SendUserID = CurrentUserInfo.mySelf.Id; + arg.gameObjID = obj.GetComponent().gameObjID; + arg.rotate = obj.transform.rotation.eulerAngles;//new Vector3(0, Time.deltaTime * rotateSpeed, 0); + arg.space = Space.World; + NetworkManager.Default.SendAsync("OBJ_ROTATE_SYNC", arg); + } } obj.GetComponent().smokeAttribute = SmokeDisaster.smokeAttribute; @@ -328,6 +339,17 @@ public class DisasterLoad : MonoBehaviour clonesync.gameObjType = cloneGameObjInfo.gameObjType; clonesync.UserID = cloneGameObjInfo.UserID; NetworkManager.Default.SendAsync("CLONE_SINGLE_DISASTER_SYNC", clonesync); + + //旋转同步,加载灾情导掉足同步克隆只同步了位置,没有同步旋转,所以要在同步一遍旋转 + if (obj.GetComponent()) + { + var arg = new ObjRotateSyncData(); + arg.SendUserID = CurrentUserInfo.mySelf.Id; + arg.gameObjID = obj.GetComponent().gameObjID; + arg.rotate = obj.transform.rotation.eulerAngles;//new Vector3(0, Time.deltaTime * rotateSpeed, 0); + arg.space = Space.World; + NetworkManager.Default.SendAsync("OBJ_ROTATE_SYNC", arg); + } } @@ -496,6 +518,17 @@ public class DisasterLoad : MonoBehaviour NetworkManager.Default.SendAsync("SET_LIQUIP_HIDE_SYNC", obj.GetComponent().gameObjID); } + //旋转同步,加载灾情导掉足同步克隆只同步了位置,没有同步旋转,所以要在同步一遍旋转 + if (obj.GetComponent()) + { + var argrotate = new ObjRotateSyncData(); + argrotate.SendUserID = CurrentUserInfo.mySelf.Id; + argrotate.gameObjID = obj.GetComponent().gameObjID; + argrotate.rotate = obj.transform.rotation.eulerAngles;//new Vector3(0, Time.deltaTime * rotateSpeed, 0); + argrotate.space = Space.World; + NetworkManager.Default.SendAsync("OBJ_ROTATE_SYNC", arg); + } + } } } @@ -545,6 +578,17 @@ public class DisasterLoad : MonoBehaviour clonesync.UserID = cloneGameObjInfo.UserID; clonesync.HitObjID = Leak1Disaster.OilTankId; NetworkManager.Default.SendAsync("CLONE_SINGLE_DISASTER_SYNC", clonesync); + + //旋转同步,加载灾情导掉足同步克隆只同步了位置,没有同步旋转,所以要在同步一遍旋转 + if (obj.GetComponent()) + { + var arg = new ObjRotateSyncData(); + arg.SendUserID = CurrentUserInfo.mySelf.Id; + arg.gameObjID = obj.GetComponent().gameObjID; + arg.rotate = obj.transform.rotation.eulerAngles;//new Vector3(0, Time.deltaTime * rotateSpeed, 0); + arg.space = Space.World; + NetworkManager.Default.SendAsync("OBJ_ROTATE_SYNC", arg); + } } } @@ -603,6 +647,17 @@ public class DisasterLoad : MonoBehaviour arg.gameObjID = cloneGameObjInfo.gameObjID; arg.Level = Leak2Disaster.level; NetworkManager.Default.SendAsync("SET_LEAK2_SYNC", clonesync); + + //旋转同步,加载灾情导掉足同步克隆只同步了位置,没有同步旋转,所以要在同步一遍旋转 + if (obj.GetComponent()) + { + var argrotate = new ObjRotateSyncData(); + argrotate.SendUserID = CurrentUserInfo.mySelf.Id; + argrotate.gameObjID = obj.GetComponent().gameObjID; + argrotate.rotate = obj.transform.rotation.eulerAngles;//new Vector3(0, Time.deltaTime * rotateSpeed, 0); + argrotate.space = Space.World; + NetworkManager.Default.SendAsync("OBJ_ROTATE_SYNC", arg); + } } } } @@ -650,6 +705,17 @@ public class DisasterLoad : MonoBehaviour clonesync.gameObjType = cloneGameObjInfo.gameObjType; clonesync.UserID = cloneGameObjInfo.UserID; NetworkManager.Default.SendAsync("CLONE_SINGLE_DISASTER_SYNC", clonesync); + + //旋转同步,加载灾情导掉足同步克隆只同步了位置,没有同步旋转,所以要在同步一遍旋转 + if (obj.GetComponent()) + { + var arg = new ObjRotateSyncData(); + arg.SendUserID = CurrentUserInfo.mySelf.Id; + arg.gameObjID = obj.GetComponent().gameObjID; + arg.rotate = obj.transform.rotation.eulerAngles;//new Vector3(0, Time.deltaTime * rotateSpeed, 0); + arg.space = Space.World; + NetworkManager.Default.SendAsync("OBJ_ROTATE_SYNC", arg); + } } } } @@ -696,6 +762,17 @@ public class DisasterLoad : MonoBehaviour clonesync.gameObjType = cloneGameObjInfo.gameObjType; clonesync.UserID = cloneGameObjInfo.UserID; NetworkManager.Default.SendAsync("CLONE_SINGLE_DISASTER_SYNC", clonesync); + + //旋转同步,加载灾情导掉足同步克隆只同步了位置,没有同步旋转,所以要在同步一遍旋转 + if (obj.GetComponent()) + { + var arg = new ObjRotateSyncData(); + arg.SendUserID = CurrentUserInfo.mySelf.Id; + arg.gameObjID = obj.GetComponent().gameObjID; + arg.rotate = obj.transform.rotation.eulerAngles;//new Vector3(0, Time.deltaTime * rotateSpeed, 0); + arg.space = Space.World; + NetworkManager.Default.SendAsync("OBJ_ROTATE_SYNC", arg); + } } } } @@ -742,6 +819,17 @@ public class DisasterLoad : MonoBehaviour clonesync.gameObjType = cloneGameObjInfo.gameObjType; clonesync.UserID = cloneGameObjInfo.UserID; NetworkManager.Default.SendAsync("CLONE_SINGLE_DISASTER_SYNC", clonesync); + + //旋转同步,加载灾情导掉足同步克隆只同步了位置,没有同步旋转,所以要在同步一遍旋转 + if (obj.GetComponent()) + { + var arg = new ObjRotateSyncData(); + arg.SendUserID = CurrentUserInfo.mySelf.Id; + arg.gameObjID = obj.GetComponent().gameObjID; + arg.rotate = obj.transform.rotation.eulerAngles;//new Vector3(0, Time.deltaTime * rotateSpeed, 0); + arg.space = Space.World; + NetworkManager.Default.SendAsync("OBJ_ROTATE_SYNC", arg); + } } } @@ -788,6 +876,16 @@ public class DisasterLoad : MonoBehaviour clonesync.gameObjType = cloneGameObjInfo.gameObjType; clonesync.UserID = cloneGameObjInfo.UserID; NetworkManager.Default.SendAsync("CLONE_SINGLE_DISASTER_SYNC", clonesync); + //旋转同步,加载灾情导掉足同步克隆只同步了位置,没有同步旋转,所以要在同步一遍旋转 + if (obj.GetComponent()) + { + var arg = new ObjRotateSyncData(); + arg.SendUserID = CurrentUserInfo.mySelf.Id; + arg.gameObjID = obj.GetComponent().gameObjID; + arg.rotate = obj.transform.rotation.eulerAngles;//new Vector3(0, Time.deltaTime * rotateSpeed, 0); + arg.space = Space.World; + NetworkManager.Default.SendAsync("OBJ_ROTATE_SYNC", arg); + } } } @@ -866,8 +964,20 @@ public class DisasterLoad : MonoBehaviour data.SendUserID = CurrentUserInfo.mySelf.Id; NetworkManager.Default.SendAsync("FORCIBLE_SCALE_SYNC", data); - } + //旋转同步,加载灾情导掉足同步克隆只同步了位置,没有同步旋转,所以要在同步一遍旋转 + if(obj.GetComponent()) + { + var arg = new ObjRotateSyncData(); + arg.SendUserID = CurrentUserInfo.mySelf.Id; + arg.gameObjID = obj.GetComponent().gameObjID; + arg.rotate = obj.transform.rotation.eulerAngles;//new Vector3(0, Time.deltaTime * rotateSpeed, 0); + arg.space = Space.World; + NetworkManager.Default.SendAsync("OBJ_ROTATE_SYNC", arg); + } + + } + } } } diff --git a/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs b/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs index f68c342..8d63650 100644 --- a/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs +++ b/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs @@ -626,21 +626,23 @@ public class TrappedMoveFree : MonoBehaviour return; } Guidance = true; - for (int i = 0; i < guidPoint.Count - 1; i++) - { - for (int k = guidPoint.Count - 2; k > i; k--) - { - float distance = Vector3.Distance(guidPoint[i], guidPoint[k]);//计算两点的距离 - if (distance < 5) - { - for (int j = k; j > i; j--) - { - guidPoint.RemoveAt(j); - } - break; - } - } - } + //一处距离进的两个点 + //for (int i = 0; i < guidPoint.Count - 1; i++) + //{ + // for (int k = guidPoint.Count - 2; k > i; k--) + // { + // float distance = Vector3.Distance(guidPoint[i], guidPoint[k]);//计算两点的距离 + // if (distance < 5) + // { + // for (int j = k; j > i; j--) + // { + // guidPoint.RemoveAt(j); + // } + // break; + // } + // } + //} + TargetPosition = guidPoint[0]; SaveFrirmanUserId = fireman.GetComponent().UserID; //引导同步 @@ -667,7 +669,25 @@ public class TrappedMoveFree : MonoBehaviour } } - + public bool HasPath( List guidPoint) + { + bool has=true; + guidPoint.Insert(0,transform.position); + for (int i = 0; i < guidPoint.Count - 1; i++) + { + for (int k = guidPoint.Count - 2; k > i; k--) + { + List corners = new List(); + var haspath = GetComponent().SetPathCorners(guidPoint[i], guidPoint[k], corners); + if (!haspath) + { + has = false; + } + + } + } + return has; + } IEnumerator checkguide() { while (Guidance && !OverMoveOrGuidance) @@ -943,7 +963,7 @@ public class TrappedMoveFree : MonoBehaviour TrappedPathFindingCommand.Instance.Execute(GetComponent().gameObjID, arg); } } - if (Vector3.Distance(transform.position, guidPoint[0]) < 2) + if (Vector3.Distance(transform.position, guidPoint[0]) < 0.6f) { Guidance = false; movestate = MoveState.IDLE; diff --git a/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedPathFind.cs b/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedPathFind.cs index 85de9b5..f70fb06 100644 --- a/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedPathFind.cs +++ b/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedPathFind.cs @@ -165,7 +165,7 @@ public class TrappedPathFind : MonoBehaviour } } } - bool setPathCorners(Vector3 sourcePosition, Vector3 targetPosition, List corners) + public bool setPathCorners(Vector3 sourcePosition, Vector3 targetPosition, List corners) { NavMeshPath NavMeshPath = new NavMeshPath(); NavMesh.CalculatePath(sourcePosition, targetPosition, filter, NavMeshPath); @@ -257,9 +257,9 @@ public class TrappedPathFind : MonoBehaviour } private void setFloorMessage() { - //设置寻路对象楼层属性 + //璁剧疆瀵昏矾瀵硅薄妤煎眰灞炴€? Vector3 adPos2 = transform.position; - Ray ray = new Ray(adPos2, -Vector3.up); + Ray ray = new Ray(adPos2 + Vector3.up, Vector3.down); RaycastHit hit = new RaycastHit(); if (Physics.Raycast(ray, out hit, 1000, LayerMask.GetMask("SoldierRoad", "CarRoad"))) { @@ -274,6 +274,12 @@ public class TrappedPathFind : MonoBehaviour } } } + /// + /// 判断当前位置到目标点是否能到达 + /// + /// + /// + /// public List GetPathCornert(Vector3 endpoint, List corners) { List gocornert = new List(); @@ -291,7 +297,7 @@ public class TrappedPathFind : MonoBehaviour /// 终点位置 /// 可寻路路径拐角点集合 /// 返回是否有可寻路路径 - private bool SetPathCorners(Vector3 startingPos, Vector3 destinationPos, List corners) + public bool SetPathCorners(Vector3 startingPos, Vector3 destinationPos, List corners) { NavMesh.CalculatePath(startingPos, destinationPos, filter, path); Vector3[] tempCorners = new Vector3[path.corners.Length]; diff --git a/Assets/Scripts/Common/GameObjectCtrl/ObjRotate.cs b/Assets/Scripts/Common/GameObjectCtrl/ObjRotate.cs index d473d0b..531a5bb 100644 --- a/Assets/Scripts/Common/GameObjectCtrl/ObjRotate.cs +++ b/Assets/Scripts/Common/GameObjectCtrl/ObjRotate.cs @@ -54,7 +54,7 @@ public class ObjRotate : MonoBehaviour { var arg = new ObjRotateSyncData(); arg.SendUserID = CurrentUserInfo.mySelf.Id; arg.gameObjID = gameObject.GetComponent().gameObjID; - arg.rotate = new Vector3(0, -Time.deltaTime * rotateSpeed, 0); + arg.rotate = transform.rotation.eulerAngles;//new Vector3(0, -Time.deltaTime * rotateSpeed, 0); arg.space = Space.World; NetworkManager.Default.SendAsync("OBJ_ROTATE_SYNC", arg); } @@ -73,7 +73,7 @@ public class ObjRotate : MonoBehaviour { var arg = new ObjRotateSyncData(); arg.SendUserID = CurrentUserInfo.mySelf.Id; arg.gameObjID = gameObject.GetComponent().gameObjID; - arg.rotate = new Vector3(0, Time.deltaTime * rotateSpeed, 0); + arg.rotate = transform.rotation.eulerAngles;//new Vector3(0, Time.deltaTime * rotateSpeed, 0); arg.space = Space.World; NetworkManager.Default.SendAsync("OBJ_ROTATE_SYNC", arg); } diff --git a/Assets/Scripts/Common/InputSystem/InputManager/InputManager.cs b/Assets/Scripts/Common/InputSystem/InputManager/InputManager.cs index 6811a68..22759d8 100644 --- a/Assets/Scripts/Common/InputSystem/InputManager/InputManager.cs +++ b/Assets/Scripts/Common/InputSystem/InputManager/InputManager.cs @@ -1636,9 +1636,49 @@ public class InputManager : MonoBehaviour { if (!GuidanceList.Contains(hit.point)) { - GuidanceList.Add(hit.point); - GameObject hitpart = Instantiate(pointer,hit.point,Quaternion.identity); - hitpart.transform.parent = p_Hitpoint; + if(SelectedObjs.selectedCharacters[0].GetComponent().GuidanceTrapped!=null) + { + List corn = new List(); + //添加第一个点,判断被困人员当前位置能不能到达点击的点 + if (GuidanceList.Count == 0) + { + bool can= SelectedObjs.selectedCharacters[0].GetComponent(). + GuidanceTrapped.GetComponent() + .setPathCorners(SelectedObjs.selectedCharacters[0].GetComponent(). + GuidanceTrapped.transform.position, hitpoint.point, corn); + if (can) + { + GuidanceList.Add(hit.point); + GameObject hitpart = Instantiate(pointer, hit.point, Quaternion.identity); + hitpart.transform.parent = p_Hitpoint; + } + else + { + LoadPromptWin.Instance.LoadTextPromptWindow("被困人员不能从上一个引导点到达该点", 2f); + + } + } + //后续添加其他点 + else + { + bool can = SelectedObjs.selectedCharacters[0].GetComponent(). + GuidanceTrapped.GetComponent() + .setPathCorners(GuidanceList[GuidanceList.Count - 1], hitpoint.point, corn); + + if (can) + { + GuidanceList.Add(hit.point); + GameObject hitpart = Instantiate(pointer, hit.point, Quaternion.identity); + hitpart.transform.parent = p_Hitpoint; + } + else + { + LoadPromptWin.Instance.LoadTextPromptWindow("被困人员不能从上一个引导点到达该点", 2f); + + } + } + } + } } } diff --git a/Assets/Scripts/Common/NetworkSystem/NetWorkSync/OBJ_ROTATE_SYNC.cs b/Assets/Scripts/Common/NetworkSystem/NetWorkSync/OBJ_ROTATE_SYNC.cs index 5596c2e..909723e 100644 --- a/Assets/Scripts/Common/NetworkSystem/NetWorkSync/OBJ_ROTATE_SYNC.cs +++ b/Assets/Scripts/Common/NetworkSystem/NetWorkSync/OBJ_ROTATE_SYNC.cs @@ -21,7 +21,8 @@ public class OBJ_ROTATE_SYNC : NetworkMessageBehaviour { if (GetComponent().gameObjID==info.gameObjID) { - transform.Rotate(info.rotate.x,info.rotate.y,info.rotate.z,info.space); + //transform.Rotate(info.rotate.x,info.rotate.y,info.rotate.z,info.space); + transform.eulerAngles = info.rotate; } } } diff --git a/Assets/Scripts/Common/NetworkSystem/NetWorkSync/PATHFIND_SYNC.cs b/Assets/Scripts/Common/NetworkSystem/NetWorkSync/PATHFIND_SYNC.cs index 1c9451f..624c6d0 100644 --- a/Assets/Scripts/Common/NetworkSystem/NetWorkSync/PATHFIND_SYNC.cs +++ b/Assets/Scripts/Common/NetworkSystem/NetWorkSync/PATHFIND_SYNC.cs @@ -158,7 +158,7 @@ public class PATHFIND_SYNC : NetworkMessageBehaviour { //setFloorMessage(); } - if (objinfo.gameObjType == CloneObjType.fireman) + if (objinfo.gameObjType == CloneObjType.fireman|| objinfo.gameObjType==CloneObjType.trappedPerson) { setFloorMessage(); @@ -169,7 +169,7 @@ public class PATHFIND_SYNC : NetworkMessageBehaviour } if (i == corners.Count) { - if (objinfo.gameObjType == CloneObjType.fireman) + if (objinfo.gameObjType == CloneObjType.fireman || objinfo.gameObjType == CloneObjType.trappedPerson) { setFloorMessage(); diff --git a/Assets/Scripts/Common/Tools/SafeAreaMessage.cs b/Assets/Scripts/Common/Tools/SafeAreaMessage.cs index 548f93e..ba76341 100644 --- a/Assets/Scripts/Common/Tools/SafeAreaMessage.cs +++ b/Assets/Scripts/Common/Tools/SafeAreaMessage.cs @@ -7,7 +7,7 @@ using AX.NetworkSystem; public class SafeAreaMessage : MonoBehaviour { - public float sideLength = 20;//安全区边长 + public float sideLength = 10;//安全区边长 private bool flag; public int hasWounderNum=0; @@ -68,7 +68,7 @@ public class SafeAreaMessage : MonoBehaviour { //z与行数线性相关 float z = 2 * tens - 4f; float x = (-1) * units + 4.5f; - pos = new Vector3(2*x,0.25f,2*z); + pos = new Vector3(1*x,0.25f,1*z); } return pos; } diff --git a/Assets/Scripts/DongYouLiQing/BaseCommander/SkillPanel/FireManSkillPanelController.cs b/Assets/Scripts/DongYouLiQing/BaseCommander/SkillPanel/FireManSkillPanelController.cs index 913f388..5dd55fd 100644 --- a/Assets/Scripts/DongYouLiQing/BaseCommander/SkillPanel/FireManSkillPanelController.cs +++ b/Assets/Scripts/DongYouLiQing/BaseCommander/SkillPanel/FireManSkillPanelController.cs @@ -623,21 +623,45 @@ public class FireManSkillPanelController : MonoBehaviour if (InputManager.GuidanceList.Count > 0 && (Mathf.Abs(guidendpos.x - safepos.x) < 10 && Mathf.Abs(guidendpos.z - safepos.z) < 10)) { - //引导命令 - GuideLodeCmdArgs arg = new GuideLodeCmdArgs(); - arg.pathpointList = InputManager.GuidanceList; - arg.FireManID = SelectFireMan.GetComponent().gameObjID; - arg.TrappedID = SelectFireMan.GetComponent().GuidanceTrapped.GetComponent().gameObjID; - TrappedMoveFollowGuidePointCommand.Instance.Execute(SelectFireMan.GetComponent().gameObjID, arg); - InputManager.skill = false; - InputManager.IsGuidance = false; - InputManager.GuidanceList.Clear(); - for (int i = 0; i < p_Hitpoint.childCount; i++) + //if (SelectFireMan.GetComponent().GuidanceTrapped.GetComponent().HasPath(InputManager.GuidanceList)) { - Destroy(p_Hitpoint.GetChild(i).gameObject); + //引导命令 + GuideLodeCmdArgs arg = new GuideLodeCmdArgs(); + arg.pathpointList = InputManager.GuidanceList; + arg.FireManID = SelectFireMan.GetComponent().gameObjID; + arg.TrappedID = SelectFireMan.GetComponent().GuidanceTrapped.GetComponent().gameObjID; + TrappedMoveFollowGuidePointCommand.Instance.Execute(SelectFireMan.GetComponent().gameObjID, arg); + InputManager.skill = false; + InputManager.IsGuidance = false; + InputManager.GuidanceList.Clear(); + for (int i = 0; i < p_Hitpoint.childCount; i++) + { + Destroy(p_Hitpoint.GetChild(i).gameObject); + } + SelectFireMan.GetComponent().GuidanceTrapped = null; + SelectFireMan.GetComponent().workType = FireManSkills.None; } - SelectFireMan.GetComponent().GuidanceTrapped = null; - SelectFireMan.GetComponent().workType = FireManSkills.None; + //else + //{ + // InputManager.GuidanceList.Clear(); + // for (int i = 0; i < p_Hitpoint.childCount; i++) + // { + // Destroy(p_Hitpoint.GetChild(i).gameObject); + // } + // LoadPromptWin.Instance.LoadTextPromptWindow("不能将伤员引导至安全区,请重新规划路线", 3f); + + // InputManager.skill = false; + // SelectFireMan.GetComponent().workType = FireManSkills.None; + // InputManager.GuidanceList.Clear(); + // InputManager.IsGuidance = false; + // if (SelectFireMan.GetComponent().GuidanceTrapped != null) + // { + // //SelectFireMan.GetComponent().GuidanceTrapped.GetComponent().Guidance = false; + // SelectFireMan.GetComponent().GuidanceTrapped.GetComponent().CancelGuidance(); + // SelectFireMan.GetComponent().GuidanceTrapped = null; + // } + // SelectFireMan.GetComponent().workType = FireManSkills.None; + //} } else diff --git a/Assets/Scripts/SmartX1/SmartController.cs b/Assets/Scripts/SmartX1/SmartController.cs index 7f15c5f..f103c57 100644 --- a/Assets/Scripts/SmartX1/SmartController.cs +++ b/Assets/Scripts/SmartX1/SmartController.cs @@ -116,7 +116,7 @@ public class SmartController : MonoBehaviour { //Debug.Log(keyHandles[0]); //Debug.Log("异常" + ex.Message); - //GameObject.Find("Application").GetComponent().isSmartX1Exit = true; + // GameObject.Find("Application").GetComponent().isSmartX1Exit = true; Application.Quit(); return false; } @@ -140,7 +140,7 @@ public class SmartController : MonoBehaviour if (t2 - t1 > new TimeSpan(0, 0, 5)) { //Debug.Log("程序退出!"); - // GameObject.Find("Application").GetComponent().isSmartX1Exit = true; + //GameObject.Find("Application").GetComponent().isSmartX1Exit = true; Application.Quit(); } }