diff --git a/Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs b/Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs index e06433d..f1d0c91 100644 --- a/Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs +++ b/Assets/MscPublic/Assets/Scripts/MainScene/FloorControlModule/UIFloor.cs @@ -87,7 +87,12 @@ public class UIFloor : BaseToggle { foreach (var item in floorsPanelManager.AllNei) { - item.gameObject.SetActive(true); + Renderer[] renderers = item.GetComponentsInChildren(); + for (int i = 0; i < renderers.Length; i++) + { + renderers[i].enabled = true; + } + //item.gameObject.SetActive(true); } foreach (var item in floorsPanelManager.AllWai) { @@ -112,11 +117,21 @@ 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); } if (item.buildNum == data.buildNum && item.floorNum == data.floorNum && item.interlayerNum > data.interlayerNum && 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); } } @@ -134,26 +149,27 @@ public class UIFloor : BaseToggle private void ShowCloneObj() { CloneGameObjInfo[] objs = P_AllParent.GetComponentsInChildren(true); + UINameItem[] names = GameObject.Find("Canvas").transform.Find("TheHeadName").GetComponentsInChildren(true); for (int i = 0; i < objs.Length; i++) { //objs[i].gameObject.SetActive(true); - MeshRenderer[] renders = objs[i].GetComponentsInChildren(); + Renderer[] renders = objs[i].GetComponentsInChildren(); //objs[i].gameObject.SetActive(false); for (int j = 0; j < renders.Length; j++) { renders[j].enabled = true; } - ParticleSystem[] parts = objs[i].GetComponentsInChildren(); - for (int j = 0; j < parts.Length; j++) - { - parts[j].Play(); - } - SkinnedMeshRenderer[] skmeshs = objs[i].GetComponentsInChildren(); - for (int j = 0; j < skmeshs.Length; j++) - { - skmeshs[j].enabled=true; - } + //ParticleSystem[] parts = objs[i].GetComponentsInChildren(); + //for (int j = 0; j < parts.Length; j++) + //{ + // parts[j].Play(); + //} + //SkinnedMeshRenderer[] skmeshs = objs[i].GetComponentsInChildren(); + //for (int j = 0; j < skmeshs.Length; j++) + //{ + // skmeshs[j].enabled=true; + //} if (objs[i].GetComponent()) //如果是被困人员/伤员,绑定了UI { Transform ui = objs[i].GetComponent().haemal.transform; @@ -169,11 +185,23 @@ public class UIFloor : BaseToggle texts[j].enabled = true; } } + if (objs[i].GetComponent().gameObjType == CloneObjType.fireman || + objs[i].GetComponent()) + { + for (int j = 0; j < names.Length; j++) + { + if (names[j].Target == objs[i].gameObject) + { + names[j].gameObject.SetActive(true); + } + } + } } } private void HideCloneObj(FloorData data) { CloneGameObjInfo[] objs = P_AllParent.GetComponentsInChildren(); + UINameItem[] names = GameObject.Find("Canvas").transform.Find("TheHeadName").GetComponentsInChildren(true); for (int i = 0; i < objs.Length; i++) { if (objs[i].gameObject == SelectedObjs.selectedObj || SelectedObjs.selectedCharacters.Contains( objs[i].gameObject)) @@ -200,23 +228,24 @@ public class UIFloor : BaseToggle if (objs[i].floorNum > data.floorNum || (objs[i].floorNum == data.floorNum && objs[i].interlayerNum > data.interlayerNum)) { - MeshRenderer[] renders = objs[i].GetComponentsInChildren(); + Renderer[] renders = objs[i].GetComponentsInChildren(); //objs[i].gameObject.SetActive(false); for (int j = 0; j < renders.Length; j++) { renders[j].enabled = false; } - ParticleSystem[] parts = objs[i].GetComponentsInChildren(); - //objs[i].gameObject.SetActive(false); - for (int j = 0; j < parts.Length; j++) - { - parts[j].Stop(); - } - SkinnedMeshRenderer[] skmeshs = objs[i].GetComponentsInChildren(); - for (int j = 0; j < skmeshs.Length; j++) - { - skmeshs[j].enabled = false; - } + //ParticleSystem[] parts = objs[i].GetComponentsInChildren(); + ////objs[i].gameObject.SetActive(false); + //for (int j = 0; j < parts.Length; j++) + //{ + // // parts[j].Stop(); + // parts[j].GetComponent().enabled = false; + //} + //SkinnedMeshRenderer[] skmeshs = objs[i].GetComponentsInChildren(); + //for (int j = 0; j < skmeshs.Length; j++) + //{ + // skmeshs[j].enabled = false; + //} if (objs[i].GetComponent()) //如果是被困人员/伤员,绑定了UI { Transform ui = objs[i].GetComponent().haemal.transform; @@ -231,10 +260,22 @@ public class UIFloor : BaseToggle texts[j].enabled = false; } } + if (objs[i].GetComponent().gameObjType == CloneObjType.fireman || + objs[i].GetComponent()) + { + for (int j = 0; j < names.Length; j++) + { + if (names[j].Target == objs[i].gameObject) + { + names[j].gameObject.SetActive(false); + } + } + } } } } + } } //private void AddRecordUIFloor(FloorData data) diff --git a/Assets/Resources/ClonePrefabs/Tool/LifeGuaranteeCar.prefab b/Assets/Resources/ClonePrefabs/Tool/LifeGuaranteeCar.prefab index 76b8a0a..5a4c05d 100644 --- a/Assets/Resources/ClonePrefabs/Tool/LifeGuaranteeCar.prefab +++ b/Assets/Resources/ClonePrefabs/Tool/LifeGuaranteeCar.prefab @@ -9,7 +9,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 5647142648243169554} - m_Layer: 0 + m_Layer: 10 m_Name: GameObject m_TagString: Untagged m_Icon: {fileID: 0} @@ -47,7 +47,7 @@ GameObject: - component: {fileID: 3295976415008873728} - component: {fileID: 3295976415008070944} - component: {fileID: 3295976415006973920} - m_Layer: 0 + m_Layer: 10 m_Name: BR m_TagString: Untagged m_Icon: {fileID: 0} @@ -124,7 +124,7 @@ GameObject: - component: {fileID: 3295976415008873730} - component: {fileID: 3295976415008070946} - component: {fileID: 3295976415006973922} - m_Layer: 0 + m_Layer: 10 m_Name: FL m_TagString: Untagged m_Icon: {fileID: 0} @@ -201,7 +201,7 @@ GameObject: - component: {fileID: 3295976415008873732} - component: {fileID: 3295976415008070948} - component: {fileID: 3295976415006973924} - m_Layer: 0 + m_Layer: 10 m_Name: BL m_TagString: Untagged m_Icon: {fileID: 0} @@ -278,7 +278,7 @@ GameObject: - component: {fileID: 3295976415008873734} - component: {fileID: 3295976415008070950} - component: {fileID: 3295976415006973926} - m_Layer: 0 + m_Layer: 10 m_Name: Body001 m_TagString: Untagged m_Icon: {fileID: 0} @@ -356,7 +356,7 @@ GameObject: - component: {fileID: 3295976415008873740} - component: {fileID: 3295976415008070956} - component: {fileID: 3295976415006973932} - m_Layer: 0 + m_Layer: 10 m_Name: FR001 m_TagString: Untagged m_Icon: {fileID: 0} @@ -433,7 +433,7 @@ GameObject: - component: {fileID: 3295976415008873742} - component: {fileID: 3295976415008070958} - component: {fileID: 3295976415006973934} - m_Layer: 0 + m_Layer: 10 m_Name: Glass m_TagString: Untagged m_Icon: {fileID: 0} @@ -510,7 +510,7 @@ GameObject: - component: {fileID: 6261750766740231484} - component: {fileID: 6261750766730623686} - component: {fileID: 4681101533329235057} - m_Layer: 0 + m_Layer: 10 m_Name: Car m_TagString: Untagged m_Icon: {fileID: 0} @@ -583,7 +583,7 @@ GameObject: - component: {fileID: 3812798776336947794} - component: {fileID: 4825697099778776312} - component: {fileID: 3144476879247977251} - m_Layer: 0 + m_Layer: 10 m_Name: LifeGuaranteeCar m_TagString: Untagged m_Icon: {fileID: 0} diff --git a/Assets/Resources/ClonePrefabs/Tool/RescueCarrierCar.prefab b/Assets/Resources/ClonePrefabs/Tool/RescueCarrierCar.prefab index bd415ed..e6e58ce 100644 --- a/Assets/Resources/ClonePrefabs/Tool/RescueCarrierCar.prefab +++ b/Assets/Resources/ClonePrefabs/Tool/RescueCarrierCar.prefab @@ -19,7 +19,7 @@ GameObject: - component: {fileID: 2517350997227339491} - component: {fileID: 9163130459147293298} - component: {fileID: 7589846690690311285} - m_Layer: 0 + m_Layer: 10 m_Name: RescueCarrierCar m_TagString: Untagged m_Icon: {fileID: 0} @@ -197,7 +197,7 @@ GameObject: - component: {fileID: 6805425689785551169} - component: {fileID: 6805425689782126951} - component: {fileID: 6805425689783258023} - m_Layer: 0 + m_Layer: 10 m_Name: FR m_TagString: Untagged m_Icon: {fileID: 0} @@ -273,7 +273,7 @@ GameObject: m_Component: - component: {fileID: 6805425689785551171} - component: {fileID: 6805425689776006829} - m_Layer: 0 + m_Layer: 10 m_Name: Car m_TagString: Untagged m_Icon: {fileID: 0} @@ -327,7 +327,7 @@ GameObject: - component: {fileID: 6805425689785551173} - component: {fileID: 6805425689782126955} - component: {fileID: 6805425689783258027} - m_Layer: 0 + m_Layer: 10 m_Name: CheXiang m_TagString: Untagged m_Icon: {fileID: 0} @@ -404,7 +404,7 @@ GameObject: - component: {fileID: 6805425689785551175} - component: {fileID: 6805425689782126949} - component: {fileID: 6805425689783258021} - m_Layer: 0 + m_Layer: 10 m_Name: FL m_TagString: Untagged m_Icon: {fileID: 0} @@ -481,7 +481,7 @@ GameObject: - component: {fileID: 6805425689785551177} - component: {fileID: 6805425689782126953} - component: {fileID: 6805425689783258025} - m_Layer: 0 + m_Layer: 10 m_Name: CheChuang m_TagString: Untagged m_Icon: {fileID: 0} @@ -556,7 +556,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 6805425689785551179} - m_Layer: 0 + m_Layer: 10 m_Name: CheLun m_TagString: Untagged m_Icon: {fileID: 0} @@ -592,7 +592,7 @@ GameObject: - component: {fileID: 6805425689785551181} - component: {fileID: 6805425689782126957} - component: {fileID: 6805425689783258029} - m_Layer: 0 + m_Layer: 10 m_Name: BL m_TagString: Untagged m_Icon: {fileID: 0} @@ -669,7 +669,7 @@ GameObject: - component: {fileID: 6805425689785551183} - component: {fileID: 6805425689782126959} - component: {fileID: 6805425689783258031} - m_Layer: 0 + m_Layer: 10 m_Name: BR m_TagString: Untagged m_Icon: {fileID: 0} diff --git a/Assets/Resources/ClonePrefabs/Tool/Trailer.prefab b/Assets/Resources/ClonePrefabs/Tool/Trailer.prefab index e14cd13..76d361b 100644 --- a/Assets/Resources/ClonePrefabs/Tool/Trailer.prefab +++ b/Assets/Resources/ClonePrefabs/Tool/Trailer.prefab @@ -11,7 +11,7 @@ GameObject: - component: {fileID: 518475800269957360} - component: {fileID: 518475800267090132} - component: {fileID: 518475800268188180} - m_Layer: 0 + m_Layer: 10 m_Name: RF m_TagString: Untagged m_Icon: {fileID: 0} @@ -88,7 +88,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 518475800269957364} - m_Layer: 0 + m_Layer: 10 m_Name: LunZ m_TagString: Untagged m_Icon: {fileID: 0} @@ -124,7 +124,7 @@ GameObject: - component: {fileID: 518475800269957366} - component: {fileID: 518475800267090138} - component: {fileID: 518475800268188186} - m_Layer: 0 + m_Layer: 10 m_Name: RB m_TagString: Untagged m_Icon: {fileID: 0} @@ -203,7 +203,7 @@ GameObject: - component: {fileID: 518475800269957368} - component: {fileID: 518475800267090142} - component: {fileID: 518475800268188190} - m_Layer: 0 + m_Layer: 10 m_Name: LB m_TagString: Untagged m_Icon: {fileID: 0} @@ -282,7 +282,7 @@ GameObject: - component: {fileID: 518475800269957370} - component: {fileID: 518475800267090136} - component: {fileID: 518475800268188184} - m_Layer: 0 + m_Layer: 10 m_Name: LF m_TagString: Untagged m_Icon: {fileID: 0} @@ -361,7 +361,7 @@ GameObject: - component: {fileID: 518475800269957372} - component: {fileID: 518475800267090140} - component: {fileID: 518475800268188188} - m_Layer: 0 + m_Layer: 10 m_Name: Cheshen m_TagString: Untagged m_Icon: {fileID: 0} @@ -459,7 +459,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 518475800269957374} - m_Layer: 0 + m_Layer: 10 m_Name: JiuYuanChe m_TagString: Untagged m_Icon: {fileID: 0} @@ -500,7 +500,7 @@ GameObject: - component: {fileID: 195902583939705336} - component: {fileID: 114473283443032936} - component: {fileID: 114625672113104814} - m_Layer: 0 + m_Layer: 10 m_Name: Trailer m_TagString: Untagged m_Icon: {fileID: 0} diff --git a/Assets/Scenes/DongYouLiQing.unity b/Assets/Scenes/DongYouLiQing.unity index 6caf118..589912f 100644 --- a/Assets/Scenes/DongYouLiQing.unity +++ b/Assets/Scenes/DongYouLiQing.unity @@ -2127,7 +2127,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 654} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -41.1, y: 2, z: 41} + m_LocalPosition: {x: 25, y: 2, z: 45} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 7618} @@ -2237,8 +2237,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1466} - m_LocalRotation: {x: -0.09121411, y: -0.68041104, z: 0.08595596, w: -0.72203356} - m_LocalPosition: {x: -233.01926, y: 57.549503, z: 29.56483} + m_LocalRotation: {x: 0.11886275, y: -0.79958373, z: 0.16849874, w: 0.5640441} + m_LocalPosition: {x: 157.1094, y: 96.30111, z: 92.336334} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 6016} @@ -2601,13 +2601,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4690} - m_LocalRotation: {x: -0.5473439, y: 0.44767696, z: -0.44767696, w: -0.5473439} + m_LocalRotation: {x: -0.40648904, y: 0.5785903, z: -0.5785903, w: -0.40648904} m_LocalPosition: {x: 0, y: 200, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 13 - m_LocalEulerAnglesHint: {x: 90, y: 281.44, z: 0} + m_LocalEulerAnglesHint: {x: 90, y: 250.18, z: 0} --- !u!4 &7613 stripped Transform: m_CorrespondingSourceObject: {fileID: 4660608106355330, guid: f0560a995a5b6bc4fb5266e583acd3b9, @@ -224842,7 +224842,7 @@ PrefabInstance: - target: {fileID: 224181501778157638, guid: 863dfe406d9716349adc35fb55cd722c, type: 3} propertyPath: m_AnchoredPosition.y - value: -0.0000031109462 + value: 0.000027392118 objectReference: {fileID: 0} - target: {fileID: 224373752534357086, guid: 863dfe406d9716349adc35fb55cd722c, type: 3} diff --git a/Assets/Scripts/Common/Cars/AgentController.cs b/Assets/Scripts/Common/Cars/AgentController.cs index b1bd04e..73123f4 100644 --- a/Assets/Scripts/Common/Cars/AgentController.cs +++ b/Assets/Scripts/Common/Cars/AgentController.cs @@ -223,6 +223,15 @@ public class AgentController : MonoBehaviour { //发送到达目的地消息 MessageDispatcher.SendMessage("ArrivedDestination", gameObject.GetComponent().gameObjID); + if (objinfo.gameObjType == CloneObjType.fireman) + + { + setFloorMessage(); + } + else if (objinfo.GetComponent()) + { + setFloorMessage(false); + } } } } diff --git a/Assets/Scripts/Common/ChatSystem/FireSiteInfo/ExternalForce/WaitingTruckItem.cs b/Assets/Scripts/Common/ChatSystem/FireSiteInfo/ExternalForce/WaitingTruckItem.cs index b7cecdf..40b9b41 100644 --- a/Assets/Scripts/Common/ChatSystem/FireSiteInfo/ExternalForce/WaitingTruckItem.cs +++ b/Assets/Scripts/Common/ChatSystem/FireSiteInfo/ExternalForce/WaitingTruckItem.cs @@ -18,18 +18,23 @@ public class WaitingTruckItem : MonoBehaviour { string amount = ""; if (info.MyCarMessage.WaterAmount != 0) { - //amount += "(载水量:" + info.MyCarMessage.WaterAmount.ToString() + ")"; - amount += "(可用水量:" + - (info.GetComponent().TotalWater - info.GetComponent().AllUserWater) + - " L)"; - + if (info.GetComponent()) + { + //amount += "(载水量:" + info.MyCarMessage.WaterAmount.ToString() + ")"; + amount += "(可用水量:" + + (info.GetComponent().TotalWater - info.GetComponent().AllUserWater) + + " L)"; + } } if(info.MyCarMessage.FoamAmount != 0) { - //amount += "(载泡沫量:" + info.MyCarMessage.FoamAmount.ToString() + ")"; - amount += "(可用泡沫量:" + - (info.GetComponent().TotalFoam - info.GetComponent().AllUserFoam) + - " L)"; + if (info.GetComponent()) + { + //amount += "(载泡沫量:" + info.MyCarMessage.FoamAmount.ToString() + ")"; + amount += "(可用泡沫量:" + + (info.GetComponent().TotalFoam - info.GetComponent().AllUserFoam) + + " L)"; + } } GetComponent().text = truckName + amount; } diff --git a/Assets/Scripts/Common/NetworkSystem/NetWorkSync/PATHFIND_SYNC.cs b/Assets/Scripts/Common/NetworkSystem/NetWorkSync/PATHFIND_SYNC.cs index 346204c..1c9451f 100644 --- a/Assets/Scripts/Common/NetworkSystem/NetWorkSync/PATHFIND_SYNC.cs +++ b/Assets/Scripts/Common/NetworkSystem/NetWorkSync/PATHFIND_SYNC.cs @@ -158,7 +158,66 @@ public class PATHFIND_SYNC : NetworkMessageBehaviour { //setFloorMessage(); } + if (objinfo.gameObjType == CloneObjType.fireman) + + { + setFloorMessage(); + } + else if (objinfo.GetComponent()) + { + setFloorMessage(false); + } + if (i == corners.Count) + { + if (objinfo.gameObjType == CloneObjType.fireman) + + { + setFloorMessage(); + } + else if (objinfo.GetComponent()) + { + setFloorMessage(false); + } + } i++; } } + private void setFloorMessage(bool isFireman = true) + { + //璁剧疆瀵昏矾瀵硅薄妤煎眰灞炴€? + Vector3 adPos2 = transform.position; + Ray ray = new Ray(adPos2 + Vector3.up, Vector3.down); + RaycastHit hit = new RaycastHit(); + if (isFireman) + { + if (Physics.Raycast(ray, out hit, 1000, LayerMask.GetMask("SoldierRoad", "CarRoad"))) + { + if (hit.transform.gameObject.GetComponent()) + { + CloneGameObjInfo msg = GetComponent(); + CloneGameObjInfo hitinfo = hit.transform.gameObject.GetComponent(); + msg.buildNum = hitinfo.buildNum; + msg.floorNum = hitinfo.floorNum; + msg.interlayerNum = hitinfo.interlayerNum; + return; + } + } + } + else + { + if (Physics.Raycast(ray, out hit, LayerMask.NameToLayer("CarRoad"))) + { + if (hit.transform.gameObject.GetComponent()) + { + CloneGameObjInfo msg = GetComponent(); + CloneGameObjInfo hitinfo = hit.transform.gameObject.GetComponent(); + msg.buildNum = hitinfo.buildNum; + msg.floorNum = hitinfo.floorNum; + msg.interlayerNum = hitinfo.interlayerNum; + + return; + } + } + } + } }