當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。