本文整理汇总了C#中Polygon.AttachTo方法的典型用法代码示例。如果您正苦于以下问题:C# Polygon.AttachTo方法的具体用法?C# Polygon.AttachTo怎么用?C# Polygon.AttachTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polygon
的用法示例。
在下文中一共展示了Polygon.AttachTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreatePolygonForPolygon
private void CreatePolygonForPolygon(Polygon polygon)
{
Polygon newPoly = new Polygon();
Vector3 pos = polygon.Position;
newPoly.Position = pos;
mHighlightShapes.Add(newPoly);
newPoly.AttachTo(polygon, true);
newPoly.RelativeRotationZ = 0;
newPoly.Points = polygon.Points;
const int pixelsOut = 2;
GrowPolygonByPixels(pixelsOut, polygon.Z, newPoly);
InitializeNewPoly(newPoly);
}
示例2: SetCollision
public void SetCollision(Polygon polygon)
{
mCollisionCircle = null;
mCollisionAxisAlignedRectangle = null;
mCollisionLine = null;
mCollisionPolygon = polygon;
mCollisionPolygon.AttachTo(this, false);
mCollisionPolygon.ForceUpdateDependencies();
}
示例3: createCollision
private void createCollision()
{
// The polygon will be visible by default, so this will serve as both our visible representation
// as well as collision.
pCollision = ShapeManager.AddPolygon();
Point[] polygonPoints = new Point[4];
polygonPoints[0] = new Point(11, 0);
polygonPoints[1] = new Point(-11, -8);
polygonPoints[2] = new Point(-11, 8);
polygonPoints[3] = polygonPoints[0];
pCollision.Points = polygonPoints;
// Finally attach the collision to this: That makes it eaasier to access all its properties.
pCollision.AttachTo(this, false);
}