|
|
@ -22,7 +22,6 @@ |
|
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Collections.Generic; |
|
|
|
using UnityEngine; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace QFrameworkCP |
|
|
|
namespace QFrameworkCP |
|
|
|
{ |
|
|
|
{ |
|
|
@ -474,7 +473,7 @@ namespace QFrameworkCP |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public class UnRegisterOnDestroyTrigger : MonoBehaviour |
|
|
|
public class UnRegisterOnDestroyTrigger |
|
|
|
{ |
|
|
|
{ |
|
|
|
private readonly HashSet<IUnRegister> mUnRegisters = new HashSet<IUnRegister>(); |
|
|
|
private readonly HashSet<IUnRegister> mUnRegisters = new HashSet<IUnRegister>(); |
|
|
|
|
|
|
|
|
|
|
@ -499,23 +498,6 @@ namespace QFrameworkCP |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static class UnRegisterExtension |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
public static IUnRegister UnRegisterWhenGameObjectDestroyed(this IUnRegister unRegister, GameObject gameObject) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var trigger = gameObject.GetComponent<UnRegisterOnDestroyTrigger>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!trigger) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
trigger = gameObject.AddComponent<UnRegisterOnDestroyTrigger>(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trigger.AddUnRegister(unRegister); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return unRegister; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class TypeEventSystem |
|
|
|
public class TypeEventSystem |
|
|
|
{ |
|
|
|
{ |
|
|
|
private readonly EasyEvents mEvents = new EasyEvents(); |
|
|
|
private readonly EasyEvents mEvents = new EasyEvents(); |
|
|
|