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; } }
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); } }
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); } }