From 82037df50cfd248ad3b717a6f1684f59f43f341c Mon Sep 17 00:00:00 2001 From: "DESKTOP-KFV16CV\\cyt" <2268162076@qq.com> Date: Fri, 28 Aug 2020 16:32:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=81=AB=E5=9C=BA=E4=BF=A1=E6=81=AF=E3=80=814g?= =?UTF-8?q?=E5=9B=BE=E4=BC=A0=E9=80=80=E5=87=BA=E9=87=8D=E6=96=B0=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E5=8F=AF=E8=83=BD=E4=BC=9A=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20=20=20=20=20=E5=85=A8=E6=B6=B2=E9=9D=A2?= =?UTF-8?q?=E7=81=AB=E3=80=81=E8=A2=AB=E5=9B=B0=E4=BA=BA=E5=91=98=E9=80=80?= =?UTF-8?q?=E5=87=BA=E9=87=8D=E8=BF=9B=E6=9C=89=E6=97=B6=E6=8A=A5=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Resources/UI/UIViewBag.prefab | 2 +- Assets/Scenes/Menu.unity | 4 +-- .../AttributeSetting/BaseAttributeSet.cs | 7 +++- .../ChatSystem/FireSiteInfo/FireInfoToggle.cs | 11 +++--- .../Disasters/FireSpread/FireLiquipPanel.cs | 35 +++++++++++-------- .../Wound_Trapped/TrappedMoveFree.cs | 2 +- .../Common/GameObjectSelect/ObjSelectCtrl.cs | 15 +++++--- .../Common/Tools/WaterConnonController.cs | 29 ++++++++------- .../DongYouLiQing/4GMap/FourthGLookOver.cs | 7 ++++ .../DongYouLiQing/4GMap/QuadrupleDisplay.cs | 6 +++- 10 files changed, 77 insertions(+), 41 deletions(-) diff --git a/Assets/Resources/UI/UIViewBag.prefab b/Assets/Resources/UI/UIViewBag.prefab index d137364..1be53f3 100644 --- a/Assets/Resources/UI/UIViewBag.prefab +++ b/Assets/Resources/UI/UIViewBag.prefab @@ -238,7 +238,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &224027155863243544 RectTransform: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Menu.unity b/Assets/Scenes/Menu.unity index 7d3a64a..991531f 100644 --- a/Assets/Scenes/Menu.unity +++ b/Assets/Scenes/Menu.unity @@ -882,7 +882,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 177, y: -87} + m_AnchoredPosition: {x: 177, y: -86.99988} m_SizeDelta: {x: -674, y: -394} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &188155149 @@ -7763,7 +7763,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 463122421b96dea4e8c06b56183b15aa, type: 3} + m_Sprite: {fileID: 21300000, guid: 1ac4104c2fed0e44f816354e5e69adcc, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 diff --git a/Assets/Scripts/Common/AttributeSetting/BaseAttributeSet.cs b/Assets/Scripts/Common/AttributeSetting/BaseAttributeSet.cs index 55b8b39..9174fce 100644 --- a/Assets/Scripts/Common/AttributeSetting/BaseAttributeSet.cs +++ b/Assets/Scripts/Common/AttributeSetting/BaseAttributeSet.cs @@ -40,7 +40,12 @@ public abstract class BaseAttributeSet : MonoBehaviour MessageDispatcher.RemoveListener("DELETE_COMMAND", Close); MessageDispatcher.RemoveListener("GROUP_DISMISS", Close);//删除组 } - + public virtual void OnDestroy() + { + MessageDispatcher.RemoveListener("DELETE_ALL_COMMAND", Close); + MessageDispatcher.RemoveListener("DELETE_COMMAND", Close); + MessageDispatcher.RemoveListener("GROUP_DISMISS", Close);//删除组 + } private void Close(IMessage msg) { gameObject.SetActive(false); diff --git a/Assets/Scripts/Common/ChatSystem/FireSiteInfo/FireInfoToggle.cs b/Assets/Scripts/Common/ChatSystem/FireSiteInfo/FireInfoToggle.cs index 42072db..1c39bea 100644 --- a/Assets/Scripts/Common/ChatSystem/FireSiteInfo/FireInfoToggle.cs +++ b/Assets/Scripts/Common/ChatSystem/FireSiteInfo/FireInfoToggle.cs @@ -24,11 +24,14 @@ public class FireInfoToggle : BaseToggle } public void CancelToggle(IMessage obj) { - var num = (int)obj.Data; - int myNum = int.Parse(gameObject.name); - if (num == myNum) + if (gameObject) { - GetComponent().isOn = false; + var num = (int)obj.Data; + int myNum = int.Parse(gameObject.name); + if (num == myNum) + { + GetComponent().isOn = false; + } } } public override void RespondFun(bool value) diff --git a/Assets/Scripts/Common/Disasters/FireSpread/FireLiquipPanel.cs b/Assets/Scripts/Common/Disasters/FireSpread/FireLiquipPanel.cs index bd55798..33412eb 100644 --- a/Assets/Scripts/Common/Disasters/FireSpread/FireLiquipPanel.cs +++ b/Assets/Scripts/Common/Disasters/FireSpread/FireLiquipPanel.cs @@ -113,23 +113,28 @@ public class FireLiquipPanel : BaseAttributeSet private void SureClick() { - SetTime = Mtime * 60 + Stime; - string settimestring = SecondToHMS(SetTime); - chooseObj.GetComponent().showTime = settimestring; - - //发送设置时间 - MessageDispatcher.SendMessage("SetTime", new SetLiquipdata() { - LiquipId = chooseObj.GetComponent().gameObjID, - time=settimestring, - }); - MessageDispatcher.SendMessage("CANCEL_OBJ_SELECTED"); - - if (GameSettings.othersSettings.mode != Mode.DisasterManagement) + if (chooseObj&&chooseObj.GetComponent()) { - NetworkManager.Default.SendAsync("SET_LIQUIP_HIDE_SYNC", chooseObj.GetComponent().gameObjID); - } + SetTime = Mtime * 60 + Stime; + string settimestring = SecondToHMS(SetTime); + chooseObj.GetComponent().showTime = settimestring; + + //发送设置时间 + MessageDispatcher.SendMessage("SetTime", new SetLiquipdata() + { + LiquipId = chooseObj.GetComponent().gameObjID, + time = settimestring, + }); + MessageDispatcher.SendMessage("CANCEL_OBJ_SELECTED"); - LoadPromptWin.Instance.LoadTextPromptWindow("设置成功",1f); + if (GameSettings.othersSettings.mode != Mode.DisasterManagement) + { + NetworkManager.Default.SendAsync("SET_LIQUIP_HIDE_SYNC", chooseObj.GetComponent().gameObjID); + } + + LoadPromptWin.Instance.LoadTextPromptWindow("设置成功", 1f); + } + } public void Close() diff --git a/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs b/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs index 4d76d5a..ef885f0 100644 --- a/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs +++ b/Assets/Scripts/Common/Disasters/Wound_Trapped/TrappedMoveFree.cs @@ -915,7 +915,7 @@ public class TrappedMoveFree : MonoBehaviour } if (!firemanHit && !IsBefirstAirOrMoving) { - if (CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id) + if (CurrentUserInfo.room!=null&&CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id) { float rang = UnityEngine.Random.Range(2f, 8f); StartCoroutine(randompoint(rang)); diff --git a/Assets/Scripts/Common/GameObjectSelect/ObjSelectCtrl.cs b/Assets/Scripts/Common/GameObjectSelect/ObjSelectCtrl.cs index a9ea09e..b655420 100644 --- a/Assets/Scripts/Common/GameObjectSelect/ObjSelectCtrl.cs +++ b/Assets/Scripts/Common/GameObjectSelect/ObjSelectCtrl.cs @@ -133,10 +133,17 @@ public class ObjSelectCtrl : MonoBehaviour } else { - // 没有背包的对象关闭背包 - UIManager.HideView(); - // 关闭仓库界面 - UIManager.HideView(); + if (GameObject.Find("UIViewBag")) + { + // 没有背包的对象关闭背包 + UIManager.HideView(); + } + if (GameObject.Find("UIViewEquipLib")) + { + // 关闭仓库界面 + UIManager.HideView(); + } + } } } diff --git a/Assets/Scripts/Common/Tools/WaterConnonController.cs b/Assets/Scripts/Common/Tools/WaterConnonController.cs index 69fe7ae..535f33c 100644 --- a/Assets/Scripts/Common/Tools/WaterConnonController.cs +++ b/Assets/Scripts/Common/Tools/WaterConnonController.cs @@ -601,20 +601,25 @@ public class WaterConnonController : MonoBehaviour } for (int i = 0; i < allwatersource.Count; i++) { - WaterSource ws = EntitiesManager.Instance.GetEntityByID(allwatersource[i]).GetComponent(); - if (ws.TotalWater != -100) + if (EntitiesManager.Instance.GetEntityByID(allwatersource[i])!=null&& + EntitiesManager.Instance.GetEntityByID(allwatersource[i]).GetComponent()) { - remainwater += (ws.TotalWater - ws.AllUserWater); - //if (ws.GetComponent()) - //{ - // allflow += ws.GetComponent().Flow; - //} - } - else - { - remainwater = -100; - break; + WaterSource ws = EntitiesManager.Instance.GetEntityByID(allwatersource[i]).GetComponent(); + if (ws.TotalWater != -100) + { + remainwater += (ws.TotalWater - ws.AllUserWater); + //if (ws.GetComponent()) + //{ + // allflow += ws.GetComponent().Flow; + //} + } + else + { + remainwater = -100; + break; + } } + } int remaintime = 0; //allflow += Flow; diff --git a/Assets/Scripts/DongYouLiQing/4GMap/FourthGLookOver.cs b/Assets/Scripts/DongYouLiQing/4GMap/FourthGLookOver.cs index 2eb3212..7427420 100644 --- a/Assets/Scripts/DongYouLiQing/4GMap/FourthGLookOver.cs +++ b/Assets/Scripts/DongYouLiQing/4GMap/FourthGLookOver.cs @@ -21,6 +21,13 @@ public class FourthGLookOver : BaseToggle { MessageDispatcher.AddListener("4GNobodySelected", ClearSelectedPerson); MessageDispatcher.AddListener("QuadrupleMode", ControlLookOverMode); } + public override void OnDestroy() + { + base.OnDestroy(); + MessageDispatcher.RemoveListener("FourthGLookOver", SetSelectedPerson); + MessageDispatcher.RemoveListener("4GNobodySelected", ClearSelectedPerson); + MessageDispatcher.RemoveListener("QuadrupleMode", ControlLookOverMode); + } /// /// 开启四分屏模式时,查看模式不可用 /// diff --git a/Assets/Scripts/DongYouLiQing/4GMap/QuadrupleDisplay.cs b/Assets/Scripts/DongYouLiQing/4GMap/QuadrupleDisplay.cs index e7b6752..3811e0e 100644 --- a/Assets/Scripts/DongYouLiQing/4GMap/QuadrupleDisplay.cs +++ b/Assets/Scripts/DongYouLiQing/4GMap/QuadrupleDisplay.cs @@ -11,7 +11,11 @@ public class QuadrupleDisplay : MonoBehaviour { MessageDispatcher.AddListener("QuadDisplay", InstantiateDisplay); //MessageDispatcher.AddListener("QuadrupleMode", DeleteAllDisplay); } - void InstantiateDisplay(IMessage obj) + private void OnDestroy() + { + MessageDispatcher.RemoveListener("QuadDisplay", InstantiateDisplay); + } + void InstantiateDisplay(IMessage obj) { var info = (CloneGameObjInfo)obj.Data; GameObject item = Instantiate(itemPre, transform);