为什么有的是Bind 有的是T喔
来自课程:【旧版不推荐学习】游戏编程框架 - 基于StrangeIoc和Unity5.3
commandBinder.Bind(ContextEvent.START).To<StartCommand>() 和 commandBinder.Bind(Demo1CommandEvent.RequestScoreCommand).Bind<RequestScoreCommand>();有什么区别
来自课程:【旧版不推荐学习】游戏编程框架 - 基于StrangeIoc和Unity5.3
commandBinder.Bind(ContextEvent.START).To<StartCommand>() 和 commandBinder.Bind(Demo1CommandEvent.RequestScoreCommand).Bind<RequestScoreCommand>();有什么区别
siki 1 楼
绑定的话都是 bind to
不能两个bind的
ck3x9 楼主 2 楼
@siki 视频里是这么写的···奇怪
//model
//service
injectionBinder.Bind<IScoreService>().Bind<ScoreService>().ToSingleton();//表示这个对象只会在整个工程中生成一个
//command
commandBinder.Bind(Demo1CommandEvent.RequestScoreCommand).Bind<RequestScoreCommand>();
//mediator
mediationBinder.Bind<CubeView>().To<CubeMediator>();
//绑定开始事件 一个startcommand
commandBinder.Bind(ContextEvent.START).To<StartCommand>().Once();
有的是To 两个Bind的是啥意思
登录后可以回复