当前位置: 首页>>代码示例>>C#>>正文


C# Collision.PassHeading方法代码示例

本文整理汇总了C#中Collision.PassHeading方法的典型用法代码示例。如果您正苦于以下问题:C# Collision.PassHeading方法的具体用法?C# Collision.PassHeading怎么用?C# Collision.PassHeading使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Collision的用法示例。


在下文中一共展示了Collision.PassHeading方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCreate

        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);


            SetContentView(Resource.Layout.ScaleImage);

            // Register our sensor listener
            _sensorManager = (SensorManager) GetSystemService(SensorService);
            _sensorListener = new CustomListener(_sensorManager);
            _sensorListener.AccelerationProcessor.OnValueChanged += AccelerationProcessorOnValueChanged;
            _sensorListener.RotationProcessor.OnValueChanged += RotationProcessorOnValueChanged;

            // Class that will handle drawing of the map
            _mapMaker = new MapMaker();
            _mapMaker.Initialize(Resources);

            var graphAsset = Assets.Open("dcsGroundFloor.xml");
            var graphInstance = Graph.Load(graphAsset);

            _mapMaker.PathfindingGraph = graphInstance;

            _collision = new Collision(graphInstance, new StepDetector());
            _collision.SetLocation(707.0f, 677.0f);
            _collision.PassHeading(90);
            
            _collision.PositionChanged += CollisionOnPositionChanged;
            _collision.StepDetector.OnStep += StepDetectorOnStep;

            collisionMap = BitmapFactory.DecodeResource(Resources,Resource.Drawable.dcsFloor);

            _walCol = new WallCollision((x,y)=>collisionMap.GetPixel(x,y));
            _collision.WallCol = _walCol;


            pf = new Pathfinding.Pathfinding(new Dictionary<int, Stream>()
            {
                {0,Assets.Open("dcsGroundFloor.xml") },
                {1,Assets.Open("dcsFloor1.xml") }
            },Assets.Open("Rooms.xml") );
            pf.CurrentFloor = 0;


            while (true)
            {
                if (pf.Ready)
                    break;
                Thread.Sleep(500);
            }

            var result = pf.FindPath(new GraphLocatable(609, 457, 1), new GraphLocatable(1256, 80, 0));


            setUpUITabs();
        }
开发者ID:dcbright01,项目名称:Navigator,代码行数:55,代码来源:MainActivity.cs


注:本文中的Collision.PassHeading方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。