コード例 #1
0
            public void PrepareGame()
            {
                _appEventSystem.LevelReady += StartGame;
                gameEventSystem             = new GameEventSystem();

                SimpleDependencyInjection.getInstance().Bind <GameEventSystem>(gameEventSystem);

                gameEventSystem.OnReachedGoalArea    += handleReachedGoal;
                gameEventSystem.OnDronesCoughtPlayer += handleDronesCaughtPlayer;
            }
コード例 #2
0
            private void Awake()
            {
                controller = GetComponent <CharacterController>();
                animator   = GetComponent <Animator>();

                pausableAnimation = new PausableAnimation(animator);

                SimpleDependencyInjection.getInstance().Inject(this);

                gameEventSystem.OnGameStateChanged += GameStateChanged;
            }
コード例 #3
0
        void SetupServices()
        {
            SimpleDependencyInjection di = SimpleDependencyInjection.getInstance();

            _appEventSystem = new ApplicationEventSystem();
            _scheduler      = GetComponent <Scheduler>();

            di.Bind <GameConfiguration>(GameConfig);
            di.Bind <ApplicationEventSystem>(_appEventSystem);
            di.Bind <Scheduler>(_scheduler);

            Debug.Log("Bound all services.");
        }
コード例 #4
0
        public static IBusClient CreateClient(RawRabbitOptions options = null)
        {
            options = options ?? new RawRabbitOptions();
            options.DependencyInjection  = options.DependencyInjection ?? (register => { });
            options.DependencyInjection += register => register.AddSingleton <IConfigurationEvaluator, ConfigurationEvaluator>();
            options.ClientConfiguration  = options?.ClientConfiguration ?? RawRabbitConfiguration.Local;
            options.Plugins              = options.Plugins ?? (builder => { });
            options.Plugins             += builder => builder
                                           .UseMessageContext(context => new MessageContext {
                GlobalRequestId = Guid.NewGuid()
            })
                                           .UseContextForwarding();
            var simpleIoc = new SimpleDependencyInjection();
            var client    = Instantiation.RawRabbitFactory.CreateSingleton(options, simpleIoc, ioc => simpleIoc);

            return(new BusClient(client, simpleIoc.GetService <IConfigurationEvaluator>()));
        }
コード例 #5
0
 public void Init()
 {
     _di = new SimpleDependencyInjection();
     _di.Register <IVehicleDAO, SampleVehicleDAO>(ObjectLifeTime.Transient);
     _di.Register <IVehicleService, VehicleService>(ObjectLifeTime.Transient);
 }
コード例 #6
0
 public TrailSystem()
 {
     SimpleDependencyInjection.getInstance().Inject(this);
 }
コード例 #7
0
 GameCamera()
 {
     SimpleDependencyInjection.getInstance().Inject(this);
 }
コード例 #8
0
 private void Awake()
 {
     SimpleDependencyInjection.getInstance().Inject(this);
 }
コード例 #9
0
 MainMenuHandler()
 {
     SimpleDependencyInjection.getInstance().Inject(this);
 }
コード例 #10
0
 public GameOverHandler()
 {
     SimpleDependencyInjection.getInstance().Inject(this);
 }
コード例 #11
0
ファイル: Drones.cs プロジェクト: kastenbutt/painthtecity
            public Drones()
            {
                SimpleDependencyInjection.getInstance().Inject(this);

                _gameEventSystem.OnGameStateChanged += handleGameStateChanged;
            }
コード例 #12
0
ファイル: GoalArea.cs プロジェクト: kastenbutt/painthtecity
 private void Awake()
 {
     boxCollider = GetComponent <BoxCollider>();
     SimpleDependencyInjection.getInstance().Inject(this);
 }
コード例 #13
0
 public GameLogic()
 {
     SimpleDependencyInjection.getInstance().Inject(this);
 }
コード例 #14
0
        public static Disposable.BusClient CreateSingleton(RawRabbitOptions options = null)
        {
            var ioc = new SimpleDependencyInjection();

            return(CreateSingleton(options, ioc, register => ioc));
        }
コード例 #15
0
        public static InstanceFactory CreateInstanceFactory(RawRabbitOptions options = null)
        {
            var ioc = new SimpleDependencyInjection();

            return(CreateInstanceFactory(options, ioc, register => ioc));
        }
コード例 #16
0
ファイル: HUDLength.cs プロジェクト: kastenbutt/painthtecity
 public HUDLength()
 {
     SimpleDependencyInjection.getInstance().Inject(this);
 }