コード例 #1
0
        public MyAnimalBotLogic(MyAnimalBot bot) : base(bot)
        {
            MyBotNavigation navigation = this.AnimalBot.Navigation;

            navigation.AddSteering(new MyTreeAvoidance(navigation, 0.1f));
            this.m_characterAvoidance = new MyCharacterAvoidance(navigation, 1f);
            navigation.AddSteering(this.m_characterAvoidance);
            navigation.MaximumRotationAngle = new float?(MathHelper.ToRadians((float)23f));
        }
コード例 #2
0
ファイル: MySandboxBot.cs プロジェクト: fluxit/SpaceEngineers
        public MySandboxBot(MyPlayer botPlayer, MyBotDefinition botDefinition)
        {
            m_definition = botDefinition as MyAgentDefinition;

            m_player = botPlayer;
            m_navigation = new MyBotNavigation();
            m_respawnRequestSent = false;
            m_actionCollection = null;
            m_botMemory = new MyBotMemory(this);

            m_player.Controller.ControlledEntityChanged += Controller_ControlledEntityChanged;

            m_navigation.ChangeEntity(m_player.Controller.ControlledEntity);
        }
コード例 #3
0
        public void EnableCharacterAvoidance(bool isTrue)
        {
            MyBotNavigation navigation = this.AnimalBot.Navigation;
            bool            flag       = navigation.HasSteeringOfType(this.m_characterAvoidance.GetType());

            if (isTrue && !flag)
            {
                navigation.AddSteering(this.m_characterAvoidance);
            }
            else if (!isTrue & flag)
            {
                navigation.RemoveSteering(this.m_characterAvoidance);
            }
        }
コード例 #4
0
 public MyTreeAvoidance(MyBotNavigation navigation, float weight)
     : base(navigation, weight) { }
コード例 #5
0
        public MyAgentBot(MyPlayer player, MyBotDefinition botDefinition)
        {
            m_player = player;
            m_navigation = new MyBotNavigation(); 
            m_actionCollection = null;
            m_botMemory = new MyBotMemory(this);
            m_botDefinition = botDefinition as MyAgentDefinition;

            m_removeAfterDeath = m_botDefinition.RemoveAfterDeath;
            m_respawnRequestSent = false;
            m_botRemoved = false;

            m_player.Controller.ControlledEntityChanged += Controller_ControlledEntityChanged;
            m_navigation.ChangeEntity(m_player.Controller.ControlledEntity);

            Sandbox.Game.Gui.MyCestmirDebugInputComponent.PlacedAction += DebugGoto;
        }
コード例 #6
0
ファイル: MyBotAiming.cs プロジェクト: 2asoft/SpaceEngineers
 public MyBotAiming(MyBotNavigation parent)
 {
     m_parent = parent;
     m_mode = AimingMode.FOLLOW_MOVEMENT;
     m_rotationHint = Vector3.Zero;
 }
コード例 #7
0
 public MyCharacterAvoidance(MyBotNavigation botNavigation, float weight)
     : base(botNavigation, weight)
 {
 }