コード例 #1
0
        public override void Simulate()
        {
            if (MyPerGameSettings.EnableAi)
            {
                // Pathfinding should be updated before the bots are simulated, so that the changes
                // in meshes and voxels are reflected in the new meshes if the bots want to do some pathfinding
                if (MyFakes.DEBUG_ONE_VOXEL_PATHFINDING_STEP_SETTING)
                {
                    if (!MyFakes.DEBUG_ONE_VOXEL_PATHFINDING_STEP)
                        // voxel pathfinding step isn't allowed - it disables also other AI stuff
                        return;
                }
                else
                {
                    if (MyFakes.DEBUG_ONE_AI_STEP_SETTING)
                        if (!MyFakes.DEBUG_ONE_AI_STEP)
                            // AI step isn't allowed
                            return;
                        else
                            // disable next AI step - and do one
                            MyFakes.DEBUG_ONE_AI_STEP = false;
                }

                MySimpleProfiler.Begin("AI");
                if (m_pathfinding != null)
					m_pathfinding.Update();
				ProfilerShort.Begin("MyAIComponent.Simulate()");
                base.Simulate();
                m_behaviorTreeCollection.Update();
                m_botCollection.Update();

                ProfilerShort.End();
                MySimpleProfiler.End("AI");
            }
        }
コード例 #2
0
ファイル: MyAIComponent.cs プロジェクト: caomw/SpaceEngineers
        public override void Simulate()
        {
            if (MyPerGameSettings.EnableAi)
            {
                // Pathfinding should be updated before the bots are simulated, so that the changes
                // in meshes and voxels are reflected in the new meshes if the bots want to do some pathfinding
                m_pathfinding.Update();

                ProfilerShort.Begin("MyAIComponent.Simulate()");
                base.Simulate();
                m_behaviorTreeCollection.Update();
                m_botCollection.Update();
                ProfilerShort.End();
            }
        }