本文整理汇总了C#中FlatRedBall.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# FlatRedBall.Remove方法的具体用法?C# FlatRedBall.Remove怎么用?C# FlatRedBall.Remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlatRedBall
的用法示例。
在下文中一共展示了FlatRedBall.Remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckTrashCollision
private void CheckTrashCollision(Orbit1 orbit1Instance, FlatRedBall.Math.PositionedObjectList<Trash> trashList, int p)
{
var trashLockoutFromSpace = new List<Trash>();
foreach (var trash in trashList.Where(t => !t.Attached))
{
//Check if trash hit other trash
foreach (var otherTrash in trashList)
{
//Ignore trashes on the planet
if (otherTrash == trash || otherTrash.OnConveyor)
{
continue;
}
if (trash.CollisionCircle.CollideAgainstBounce(otherTrash.CollisionCircle, 10F, 0.1F, 0))
{
//trash.AttachTo(null, false);
//otherTrash.AttachTo(null, false);
trash.Detach();
otherTrash.Detach();
//trash fly to space
return;
}
}
//Only allow attach once
if (!trash.Attached && trash.CollisionCircle.CollideAgainstBounce(Orbit1Instance.Circle, 0, 100, 2))
{
trash.AttachTo(Orbit1Instance, true);
trash.Attached = true;
}
int halfScreenWidth = FlatRedBallServices.ClientWidth/2;
int halfScreenHeight = FlatRedBallServices.ClientHeight/2;
if (!trash.OnConveyor && (trash.X > halfScreenWidth ||
trash.X < -halfScreenWidth ||
trash.Y > halfScreenHeight ||
trash.Y < -halfScreenHeight))
{
trashLockoutFromSpace.Add(trash);
}
}
//Remove the trash from game
foreach (var trash in trashLockoutFromSpace)
{
trashList.Remove(trash);
trash.RemoveSelfFromListsBelongingTo();
trash.Destroy();
}
}