Esempio n. 1
0
        private void SpawningBots()
        {
            for (var index = 0; index < _countBotSideOne; index++)
            {
                var tempBot = Object.Instantiate(ServiceLocatorMonoBehaviour.GetService <Reference>().BotTypeOne,
                                                 Patrol.GenericStartingPoint(ServiceLocatorMonoBehaviour.GetService <CharacterController>().transform, Affiliation.SideOne),
                                                 Quaternion.identity);
                tempBot.Agent.avoidancePriority = 0;
                // tempBot.Target = ServiceLocatorMonoBehaviour.GetService<CharacterController>().transform;
                tempBot.Target = targetBot.transform;

                tempBot.Agent.avoidancePriority = 0;
                tempBot.AffiliationSide         = Affiliation.SideOne;
                AddBotToList(tempBot);
            }

            for (var index = 0; index < _countBotSideTwo; index++)
            {
                var tempBot = Object.Instantiate(ServiceLocatorMonoBehaviour.GetService <Reference>().BotTypeTwo,
                                                 Patrol.GenericStartingPoint(ServiceLocatorMonoBehaviour.GetService <CharacterController>().transform, Affiliation.SideTwo),
                                                 Quaternion.identity);

                tempBot.Agent.avoidancePriority = 0;
                tempBot.AffiliationSide         = Affiliation.SideTwo;
                AddBotToList(tempBot);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 3
0
        public void OnStart()
        {
            for (var index = 0; index < CountBot; index++)
            {
                var tempBot = Object.Instantiate(Main.Instance.RefBotPrefab,
                                                 Patrol.GenericPoint(Spawner),
                                                 Quaternion.identity);

                tempBot.Agent.avoidancePriority = index;
                tempBot.Target = Main.Instance.Player;                 //todo разных противников
                AddBotToList(tempBot);
                tempBot.OnDieChange += RemoveBotToList;
            }
        }
Esempio n. 4
0
        public void OnStart()
        {
            for (var index = 0; index < CountBot; index++)
            {
                var bot     = Resources.Load <Bot>("Bot");
                var tempBot = Object.Instantiate(                //Main.Instance.RefBotPrefab,
                    bot,
                    Patrol.GenericPoint(Main.Instance.Player),
                    Quaternion.identity);

                tempBot.Agent.avoidancePriority = index;
                tempBot.Target = Main.Instance.Player;                 // разных противников
                AddBotToList(tempBot);
            }
        }