本文整理汇总了C#中Collision.SetLocation方法的典型用法代码示例。如果您正苦于以下问题:C# Collision.SetLocation方法的具体用法?C# Collision.SetLocation怎么用?C# Collision.SetLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Collision
的用法示例。
在下文中一共展示了Collision.SetLocation方法的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();
}