框架的开启
1.创建ContextRoot类且继承contextView这是框架的入口类
using strange.extensions.context.impl;
using UnityEngine;
namespace Core
{
public class GameContextRoot : ContextView
{
void Awake()
{
Debug.Log("框架开启");
this.context = new GameContext(this);
}
}
}
2.创建GameContext类且继承MvcsContext
using strange.extensions.context.api;
using strange.extensions.context.impl;
using UnityEngine;
namespace Core
{
public class GameContext : MVCSContext
{
public GameContext(MonoBehaviour context) : base(context)
{
Debug.Log("完成启动");
}
}
}
将ContextRoot绑定在对象上 点击运行框架启动成功