1.
mModel = this.GetModel<ICounterAppModel>();
2.
public static class CanGetModelExtension
{
public static T GetModel<T>(this ICanGetModel self) where T : class, IModel
{
return self.GetArchitecture().GetModel<T>();
}
}
3.
public IArchitecture GetArchitecture()
{
return CounterApp.Interface;
}
4.
public static IArchitecture Interface
{
get
{
if (mArchitecture == null)
{
MakeSureArchitecture();
}
return mArchitecture;
}
}
5.
static void MakeSureArchitecture()
{
if (mArchitecture == null)
{
mArchitecture = new T();
mArchitecture.Init();
6.
protected override void Init()
{
// 注册 System
this.RegisterSystem<IAchievementSystem>(new AchievementSystem());
Unity QFramework
最新推荐文章于 2024-07-23 20:14:58 发布