public void Initialization()
        {
            _weapons = ServiceLocatorMonoBehaviour.GetService <CharacterController>().
                       GetComponentsInChildren <Weapon>().ToList();

            foreach (var weapon in Weapons)
            {
                weapon.IsVisible = false;
            }

            FlashLightModel = Object.FindObjectOfType <FlashLightModel>();
            FlashLightModel.Switch(FlashLightActiveType.Off);
        }
Пример #2
0
        public void Initialization()
        {
            for (var index = 0; index < _countBot; index++)
            {
                var tempBot = Object.Instantiate(ServiceLocatorMonoBehaviour.GetService <Reference>().Bot,
                                                 Patrol.GenericPoint(ServiceLocatorMonoBehaviour.GetService <CharacterController>().transform),
                                                 Quaternion.identity);

                tempBot.Agent.avoidancePriority = index;
                tempBot.Target = ServiceLocatorMonoBehaviour.GetService <CharacterController>().transform;

                //todo разных противников
                AddBotToList(tempBot);
            }
        }
Пример #3
0
        public Controllers()
        {
            IMotor motor = default;

            if (Application.platform == RuntimePlatform.PS4)
            {
                //todo SonyPlaystation
            }
            else
            {
                motor = new UnitMotor(ServiceLocatorMonoBehaviour.GetService <CharacterController>());
            }
            ServiceLocator.SetService(new PlayerController(motor));
            ServiceLocator.SetService(new FlashLightController());
            ServiceLocator.SetService(new InputController());
            _executeControllers = new IExecute[3];

            _executeControllers[0] = ServiceLocator.Resolve <PlayerController>();
            _executeControllers[1] = ServiceLocator.Resolve <FlashLightController>();
            _executeControllers[2] = ServiceLocator.Resolve <InputController>();
        }
Пример #4
0
        public Controllers()
        {
            IMotor motor = new UnitMotor(ServiceLocatorMonoBehaviour.GetService <CharacterController>());

            ServiceLocator.SetService(new TimeRemainingController());
            ServiceLocator.SetService(new Inventory());
            ServiceLocator.SetService(new PlayerController(motor));
            ServiceLocator.SetService(new FlashLightController());
            ServiceLocator.SetService(new WeaponController());
            ServiceLocator.SetService(new InputController());
            ServiceLocator.SetService(new SelectionController());
            ServiceLocator.SetService(new BotController());

            _executeControllers = new IExecute[6];

            _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>();
            _executeControllers[5] = ServiceLocator.Resolve <BotController>();
        }