退出模块时清空控制器的数据
This commit is contained in:
parent
1642e93d06
commit
6033a0b34f
@ -30,7 +30,6 @@ public class DeviceController : MonoSingleton<DeviceController>
|
||||
private void OnQuit(OnModuleQuit quit)
|
||||
{
|
||||
deviceDict.Clear();
|
||||
deviceDict.Clear();
|
||||
}
|
||||
|
||||
private void OnStart(OnModuleStart start)
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using QFramework;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@ -12,9 +13,15 @@ public class VarController : MonoSingleton<VarController>
|
||||
{
|
||||
base.OnSingletonInit();
|
||||
varDict = new Dictionary<string, float>();
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>(OnQuit).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
|
||||
}
|
||||
|
||||
private void OnQuit(OnModuleQuit quit)
|
||||
{
|
||||
varDict.Clear();
|
||||
}
|
||||
|
||||
public void Set(string key, float value)
|
||||
{
|
||||
if (varDict.ContainsKey(key))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user