private void ChangeAllBehaviors() { foreach (KeyValuePair <int, IMyBot> pair in MyAIComponent.Static.Bots.GetAllBots()) { MyAgentBot bot = pair.Value as MyAgentBot; if ((bot != null) && bot.BotDefinition.Commandable) { this.ChangeBotBehavior(bot); } } }
private bool TryGetBotForCharacter(MyCharacter character, out MyAgentBot bot) { bot = null; foreach (var localBot in MyAIComponent.Static.Bots.GetAllBots()) { var agent = localBot as MyAgentBot; if (agent != null && agent.AgentEntity == character) { bot = agent; return(true); } } return(false); }
private bool TryGetBotForCharacter(MyCharacter character, out MyAgentBot bot) { bot = null; using (Dictionary <int, IMyBot> .Enumerator enumerator = MyAIComponent.Static.Bots.GetAllBots().GetEnumerator()) { while (true) { if (!enumerator.MoveNext()) { break; } KeyValuePair <int, IMyBot> current = enumerator.Current; MyAgentBot bot2 = current.Value as MyAgentBot; if ((bot2 != null) && ReferenceEquals(bot2.AgentEntity, character)) { bot = bot2; return(true); } } } return(false); }
protected MyAgentActions(MyAgentBot bot) { Bot = bot; m_locationSphere = new MyRandomLocationSphere(Vector3D.Zero, 30, Vector3D.UnitX); }
private void ChangeBotBehavior(MyAgentBot bot) { MyAIComponent.Static.BehaviorTrees.ChangeBehaviorTree(Definition.BehaviorTreeName, bot); }
private bool TryGetBotForCharacter(MyCharacter character, out MyAgentBot bot) { bot = null; foreach (var localBot in MyAIComponent.Static.Bots.GetAllBots()) { var agent = localBot as MyAgentBot; if (agent != null && agent.AgentEntity == character) { bot = agent; return true; } } return false; }
private void ChangeBotBehavior(MyAgentBot bot) { MyAIComponent.Static.BehaviorTrees.ChangeBehaviorTree(Definition.BehaviorTreeName, bot); }
protected MyAgentActions(MyAgentBot bot) { Bot = bot; m_locationSphere = new MyRandomLocationSphere(Vector3D.Zero, 30, Vector3D.UnitX); }
public MyAgentCommonActions(MyAgentBot bot, MyAiTargetBase targetBase) { Bot = bot; AiTargetBase = targetBase; }
public MyAgentCommonActions(MyAgentBot bot, MyAiTargetBase targetBase) { Bot = bot; AiTargetBase = targetBase; }