diff --git a/Assets/Scenes/DummyScene.unity b/Assets/Scenes/DummyScene.unity index 02a44bb..97da214 100644 --- a/Assets/Scenes/DummyScene.unity +++ b/Assets/Scenes/DummyScene.unity @@ -171,7 +171,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!114 &546100756 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Common/EquipSystem/EquipManager.cs b/Assets/Scripts/Common/EquipSystem/EquipManager.cs index 5392a88..afa74ac 100644 --- a/Assets/Scripts/Common/EquipSystem/EquipManager.cs +++ b/Assets/Scripts/Common/EquipSystem/EquipManager.cs @@ -33,6 +33,20 @@ public class EquipManager : Singleton { MovingWaterGun.SubscribeToText(text).AddTo(this); } + public void ResetEquipmanage() + { + foreach (var item in ClientFireManBags) + { + item.EquipData = null; + item.OnAddEquip = null; + } + ClientFireManBags.Clear(); + MovingWaterGun = new IntReactiveProperty(); + SnowstormGun = new IntReactiveProperty(); + FireFightingRobot = new IntReactiveProperty(); + WaterBag = new IntReactiveProperty(); + CurrentSelectedBag = null; + } /// /// 暴风雪炮绑定数据UGUI /// diff --git a/Assets/Scripts/Common/EquipSystem/MyFrame/UIManager.cs b/Assets/Scripts/Common/EquipSystem/MyFrame/UIManager.cs index e10e9c9..3693d17 100644 --- a/Assets/Scripts/Common/EquipSystem/MyFrame/UIManager.cs +++ b/Assets/Scripts/Common/EquipSystem/MyFrame/UIManager.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; @@ -49,7 +50,10 @@ public static class UIManager public static void RegisterUI(string prefabPath) where T : UIView { - UIPath.Add(typeof(T).ToString(), prefabPath); + if (!UIPath.ContainsKey(typeof(T).ToString())) + { + UIPath.Add(typeof(T).ToString(), prefabPath); + } } public static string Normalize(string name) { @@ -247,6 +251,20 @@ public static class UIManager Views.Remove(viewName); } } - + public static void resert() + { + if (templates.Count>0) + { + templates.Clear(); + } + if (Views.Count>0) + { + Views.Clear(); + } + if (UIPath.Count>0) + { + UIPath.Clear(); + } + } } diff --git a/Assets/Scripts/Common/EquipSystem/MyFrame/UIView.cs b/Assets/Scripts/Common/EquipSystem/MyFrame/UIView.cs index 64973dc..603bf7a 100644 --- a/Assets/Scripts/Common/EquipSystem/MyFrame/UIView.cs +++ b/Assets/Scripts/Common/EquipSystem/MyFrame/UIView.cs @@ -39,7 +39,7 @@ public abstract class UIView : MonoBehaviour public virtual void Hide() { //显示的情况下才隐藏 - if (gameObject.activeSelf) + if (gameObject!=null&&gameObject.activeSelf) { gameObject.SetActive(false); if (OnHide != null) diff --git a/Assets/Scripts/Common/GameObjectSelect/ObjSelectCtrl.cs b/Assets/Scripts/Common/GameObjectSelect/ObjSelectCtrl.cs index 0f90071..a9ea09e 100644 --- a/Assets/Scripts/Common/GameObjectSelect/ObjSelectCtrl.cs +++ b/Assets/Scripts/Common/GameObjectSelect/ObjSelectCtrl.cs @@ -230,12 +230,15 @@ public class ObjSelectCtrl : MonoBehaviour DoDisSelect(SelectedObjs.selectedObj); SelectedObjs.selectedObj = null; } - - for (int i = SelectedObjs.selectedCharacters.Count - 1; i >= 0; i--) + if (SelectedObjs.selectedCharacters.Count>0) { - DoDisSelect(SelectedObjs.selectedCharacters[i]); - SelectedObjs.selectedCharacters.Remove(SelectedObjs.selectedCharacters[i]); + for (int i = SelectedObjs.selectedCharacters.Count - 1; i >= 0; i--) + { + DoDisSelect(SelectedObjs.selectedCharacters[i]); + SelectedObjs.selectedCharacters.Remove(SelectedObjs.selectedCharacters[i]); + } } + } private void SetLayerRecursively(GameObject obj, int newLayer) diff --git a/Assets/Scripts/Common/HelpClasses/WaterSource.cs b/Assets/Scripts/Common/HelpClasses/WaterSource.cs index 9ba5092..fe1414e 100644 --- a/Assets/Scripts/Common/HelpClasses/WaterSource.cs +++ b/Assets/Scripts/Common/HelpClasses/WaterSource.cs @@ -240,9 +240,9 @@ public class WaterSource : MonoBehaviour void OnDestroy() { - MessageDispatcher.AddListener("WATERCAR_BIND_CURTAINHOSE", ConnectWaterCurtain); - MessageDispatcher.AddListener("WATERCAR_DESTORY_CURTAINHOSE", DelectWaterCurtain); - MessageDispatcher.AddListener("HOSE_CONNECT_OR_DELECT", ConnectOrDelectWaterHose); + MessageDispatcher.RemoveListener("WATERCAR_BIND_CURTAINHOSE", ConnectWaterCurtain); + MessageDispatcher.RemoveListener("WATERCAR_DESTORY_CURTAINHOSE", DelectWaterCurtain); + MessageDispatcher.RemoveListener("HOSE_CONNECT_OR_DELECT", ConnectOrDelectWaterHose); // MessageDispatcher.RemoveListener("FLOW_CHANGE", TotalFlowChange); GetRealtimeConsume.getAllRealtimeConsume -= addMyRealtimeConsume; //GetAllUsed.getAllUsedAmount -= addMyUsed; diff --git a/Assets/Scripts/Common/InputSystem/InputManager/InputManager.cs b/Assets/Scripts/Common/InputSystem/InputManager/InputManager.cs index 760046e..3e626d3 100644 --- a/Assets/Scripts/Common/InputSystem/InputManager/InputManager.cs +++ b/Assets/Scripts/Common/InputSystem/InputManager/InputManager.cs @@ -94,7 +94,19 @@ public class InputManager : MonoBehaviour fireDeployCameraManager = GameObject.Find("FireDeployCamera").GetComponent(); } + public static void ResertInputmanage() + { + skill=false; + AutoArm=false; + cloneObjType = CloneObjType.None; + selectedFireDeployObjId = -1; + IsGuidance = false; + GuidanceList.Clear(); + fireDeployPrivateToolType = FireDeployPrivateToolType.None; + fireCarEngine = null; + org = null; + } void Start() { sceneType = SceneType.化工建筑; diff --git a/Assets/Scripts/Common/NetworkSystem/NetWorkSync/HAND_OVER_SYNC.cs b/Assets/Scripts/Common/NetworkSystem/NetWorkSync/HAND_OVER_SYNC.cs index 52d368c..71b445f 100644 --- a/Assets/Scripts/Common/NetworkSystem/NetWorkSync/HAND_OVER_SYNC.cs +++ b/Assets/Scripts/Common/NetworkSystem/NetWorkSync/HAND_OVER_SYNC.cs @@ -77,4 +77,10 @@ public class HAND_OVER_SYNC : NetworkMessageBehaviour { } + protected override void OnDestroy() + { + base.OnDestroy(); + OnHandOverPower = null; + OnReceivePower = null; + } } diff --git a/Assets/Scripts/Common/Tools/SnowConnonController.cs b/Assets/Scripts/Common/Tools/SnowConnonController.cs index e1fae39..8b1210a 100644 --- a/Assets/Scripts/Common/Tools/SnowConnonController.cs +++ b/Assets/Scripts/Common/Tools/SnowConnonController.cs @@ -204,6 +204,7 @@ public class SnowConnonController : MonoBehaviour if (info.gameObjID == basegameInfo.gameObjID) { paotong.transform.localEulerAngles = info.VrotateVec; + transform.localEulerAngles = info.HrotateVec; } } } @@ -416,12 +417,14 @@ public class SnowConnonController : MonoBehaviour public void Left() { - Debug.Log("left"); + transform.Rotate(0, -10, 0); + RotateSync(); } public void Right() { - Debug.Log("right"); + transform.Rotate(0, 10, 0); + RotateSync(); } void RotateSync() { @@ -429,6 +432,7 @@ public class SnowConnonController : MonoBehaviour arg.SendUserID = CurrentUserInfo.mySelf.Id; arg.gameObjID = basegameInfo.gameObjID; arg.VrotateVec = paotong.transform.localEulerAngles; + arg.HrotateVec = transform.localEulerAngles; NetworkManager.Default.SendAsync("SNOWCANNON_ROTATE_SYNC", arg); } public void Resert() diff --git a/Assets/Scripts/DongYouLiQing/BaseCommander/WaterFightFire/FireFightNormal.cs b/Assets/Scripts/DongYouLiQing/BaseCommander/WaterFightFire/FireFightNormal.cs index 8db2fae..835e9b8 100644 --- a/Assets/Scripts/DongYouLiQing/BaseCommander/WaterFightFire/FireFightNormal.cs +++ b/Assets/Scripts/DongYouLiQing/BaseCommander/WaterFightFire/FireFightNormal.cs @@ -74,7 +74,11 @@ public class FireFightNormal : MonoBehaviour //从字典中移除该普通火 if (baseinfo.gameObjType == CloneObjType.fireNormal) { - SpreadFireController.fireStruckContainDic[baseinfo.gameObjID].Remove(this); + if (SpreadFireController.fireStruckContainDic.ContainsKey(baseinfo.gameObjID)) + { + SpreadFireController.fireStruckContainDic[baseinfo.gameObjID].Remove(this); + } + } //主火(普通火)只隐藏不删除 Straightwater.Clear(); diff --git a/Assets/Scripts/DongYouLiQing/LeadGroup/ExitDrillButton.cs b/Assets/Scripts/DongYouLiQing/LeadGroup/ExitDrillButton.cs index 4963725..f8fa7b7 100644 --- a/Assets/Scripts/DongYouLiQing/LeadGroup/ExitDrillButton.cs +++ b/Assets/Scripts/DongYouLiQing/LeadGroup/ExitDrillButton.cs @@ -43,7 +43,22 @@ public class ExitDrillButton : BaseButton } UserData user = CurrentUserInfo.room.FindUserById(CurrentUserInfo.mySelf.Id); user.IsReady = false; + //重置房间 CurrentUserInfo.room = null; + + //重置选择 + if (SelectedObjs.selectedObj!=null) + { + SelectedObjs.selectedObj = null; + } + if (SelectedObjs.selectedCharacters.Count>0) + { + SelectedObjs.selectedCharacters.Clear(); + } + //重置装备信息 + EquipManager.Instance.ResetEquipmanage(); + //重置inputmanage 变量 + InputManager.ResertInputmanage(); NetworkManager.Default.SendAsync("ROOM_LEAVE_SYNC", data); SceneManager.LoadScene(GoTo.RolesSelection.ToString()); }