Example #1
0
        public Controllers()
        {
            //if (Application.platform == RuntimePlatform.PS4)

            IMotor motor = default;

            motor = new UnitMotor(ServiceLocatorMonoBehavior.GetService <CharacterController>());
            ServiceLocator.SetService(new PlayerController(motor));
            ServiceLocator.SetService(new Inventory());
            ServiceLocator.SetService(new TimeRemainingController());
            ServiceLocator.SetService(new FlashLightController());
            ServiceLocator.SetService(new InputController());
            ServiceLocator.SetService(new SelectionController());
            ServiceLocator.SetService(new WeaponController());
            ServiceLocator.SetService(new PoolController());
            //ServiceLocator.SetService(new EffectController());

            _executeControllers = new IExecute[5];

            _executeControllers[0] = ServiceLocator.Resolve <TimeRemainingController>();

            _executeControllers[1] = ServiceLocator.Resolve <PlayerController>();

            _executeControllers[2] = ServiceLocator.Resolve <FlashLightController>();

            _executeControllers[3] = ServiceLocator.Resolve <InputController>();

            _executeControllers[4] = ServiceLocator.Resolve <SelectionController>();
        }
Example #2
0
        public void Initialization()
        {
            _weapons = ServiceLocatorMonoBehavior.GetService <CharacterController>().
                       GetComponentsInChildren <Weapon>();

            foreach (var weapon in Weapons)
            {
                //Debug.Log($"weapon:{weapon}, weapon.name:{weapon.name}");
                weapon.IsVisible = false;
            }

            FlashLight = Object.FindObjectOfType <FlashLightModel>();
            FlashLight.Switch(FlashLightActiveType.Off);
        }