|
@@ -30,6 +30,17 @@ namespace FrameWorkDesign
|
|
|
public static Action<T> OnRegisterPatch = architecture => { };
|
|
|
|
|
|
private static T mArchitecture;
|
|
|
+
|
|
|
+ public static IArchitecture Instance
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ if (mArchitecture == null)
|
|
|
+ MakeSureArchitecture();
|
|
|
+ return mArchitecture;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
static void MakeSureArchitecture()
|
|
|
{
|
|
|
if (mArchitecture == null)
|
|
@@ -75,7 +86,7 @@ namespace FrameWorkDesign
|
|
|
|
|
|
public void RegisterModel<T>(T model) where T:IModel
|
|
|
{
|
|
|
- model.Architecture= this;
|
|
|
+ model.SetArchitecture(this);
|
|
|
mContainer.Register<T>(model);
|
|
|
|
|
|
if (!mInited)
|
|
@@ -105,7 +116,7 @@ namespace FrameWorkDesign
|
|
|
|
|
|
public void RegisterSystem<T>(T system) where T : ISystem
|
|
|
{
|
|
|
- system.Architecture = this;
|
|
|
+ system.SetArchitecture(this);
|
|
|
mContainer.Register<T>(system);
|
|
|
|
|
|
if (!mInited)
|