using UnityEngine;
using System.Collections;
using strange.extensions.context.impl;
using strange.extensions.context.api;
public class Demo1Context : MVCSContext {
public Demo1Context(MonoBehaviour view): base(view){}
protected override void mapBindings()//绑定映射
{
//Commond(model)
//commandBinder.Bind(Demo1CommandEvent.RequestScore).To<RequestScoreCommand>();
//commandBinder.Bind(Demo1CommandEvent.UpdateScore).To<UpdateScoreCommond>();
//Service
//injectionBinder.Bind<IScoreService>().To<ScoreService>().ToSingleton();//项目中接口只有一个实例
//mediator
//mediationBinder.Bind<CubeView>().To<CubeMediator>();//将cubeView 绑定到CubeMediator
//model
//injectionBinder.Bind<ScoreModel>().To<ScoreModel>();
//绑定开始事件 一个StartCommond
commandBinder.Bind(ContextEvent.START).To<StartCommond>().Once();
Debug.Log("commandBinder");
}
}
using UnityEngine;
using System.Collections;
using strange.extensions.context.impl;
public class Demo1ContextView : ContextView
{
void Awake(){
this.context = new Demo1Context(this);//启动框架context
Debug.Log("Demo1ContextView Awake");
}
}