コード例 #1
0
        public void CommonInstall()
        {
            SignalBusInstaller.Install(Container);
            signalBus = Container.Resolve <SignalBus>();

            gameObject = new GameObject();
            gameObject.AddComponent <PlayerUnit>();

            GameContext context = EditModeUtil.CreateGameContext(signalBus);

            Container.Bind <GameContext>().FromInstance(context).AsSingle();
        }
コード例 #2
0
        public void CommonInstall()
        {
            SignalBusInstaller.Install(Container);
            signalBus = Container.Resolve <SignalBus>();

            randomGenerator = new RandomGeneratorStub();
            var randomGeneratorMap = new Dictionary <string, IRandomGenerator>()
            {
                { "Game", randomGenerator }
            };
            var context = EditModeUtil.CreateGameContext(signalBus, randomGeneratorMap: randomGeneratorMap);

            gameObject = new GameObject();
            gameObject.AddComponent <PlayerUnit>();

            Container.Bind <GameContext>().FromInstance(context).AsSingle();
            Container.Inject(this);
        }