Browse Source

退出时清空作战部署里的数据

develop
曹衍涛 4 years ago
parent
commit
41b7ac248a
  1. 1
      Assets/ExitBack.cs
  2. 5
      Assets/Scripts/Common/EntitiesManager/EntitiesManager.cs
  3. 1
      Assets/Scripts/Common/EquipSystem/View/UIViewBag.cs
  4. 1
      Assets/Scripts/Common/EquipSystem/View/UIViewEquipLib.cs
  5. 6
      Assets/Scripts/Common/OperationalPreparation/FireEnginesData.cs

1
Assets/ExitBack.cs

@ -7,6 +7,7 @@ public class ExitBack : MonoBehaviour
// Start is called before the first frame update
void Start()
{
FireEnginesData.Instance.FireEnginesDataResert();
EntitiesManager.Instance.Reset();//跳转场景时要清空实体管理器中的对象
//UIManager.ResertUIManager();
//重置选择

5
Assets/Scripts/Common/EntitiesManager/EntitiesManager.cs

@ -96,7 +96,10 @@ public class EntitiesManager
/// <param name="go"></param>
public void AddEntity(long id, GameObject go)
{
entityMap.Add(id,go);
if (!entityMap.ContainsKey(id))
{
entityMap.Add(id,go);
}
BaseGameObjInfo baseGameObjInfo = go.GetComponent<BaseGameObjInfo>();
CloneObjType type;

1
Assets/Scripts/Common/EquipSystem/View/UIViewBag.cs

@ -36,6 +36,7 @@ public class UIViewBag : UIView {
public override void OnDestroy()
{
base.OnDestroy();
MessageDispatcher.RemoveListener("REFRESH_UIVIEW_BAG", RefreshUI);
ButtonClose.OnClicked -= ButtonClose_OnClicked;
ButtonDelete.OnClicked -= ButtonDelete_OnClicked;
ButtonClear.OnClicked -= ButtonClear_OnClicked;

1
Assets/Scripts/Common/EquipSystem/View/UIViewEquipLib.cs

@ -69,6 +69,7 @@ public class UIViewEquipLib : UIView
public override void OnDestroy()
{
base.OnDestroy();
MessageDispatcher.RemoveListener("REFRESH_UIVIEW_EQUIPLIB", RefreshUI);
CommitButton.OnClicked -= CommitButon_OnClicked;
ButtonClose.OnClicked -= ButtonClose_OnClicked;
}

6
Assets/Scripts/Common/OperationalPreparation/FireEnginesData.cs

@ -110,4 +110,10 @@ public class FireEnginesData
{
return Persons;
}
public void FireEnginesDataResert()
{
Persons.Clear();
DeptCars.Clear();
}
}

Loading…
Cancel
Save