本文整理汇总了C#中FarseerPhysics.Dynamics.Body.DestroyFixture方法的典型用法代码示例。如果您正苦于以下问题:C# Body.DestroyFixture方法的具体用法?C# Body.DestroyFixture怎么用?C# Body.DestroyFixture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FarseerPhysics.Dynamics.Body
的用法示例。
在下文中一共展示了Body.DestroyFixture方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupPhysics
protected void SetupPhysics()
{
if(body == null) {
body = GetComponent<FSBodyComponent>().PhysicsBody;
shape = GetComponent<FSShapeComponent>().GetShape();
shape.Radius = minRadius;
body.DestroyFixture(body.FixtureList[0]);
body.CreateFixture(shape);
CollisionPresets.SetFixtureCollision(body.FixtureList[0], collisionSetting);
expansionRate = (maxRadius - minRadius) / expansionTime;
gameObject.transform.localScale = new Vector3(2*minRadius, 2*minRadius, 1.0f);
}
body.IsSensor = true;
body.GravityScale = 0.0f; //Explosions aren't affected by gravity
body.OnCollision += OnCollisionEvent;
}
示例2: DestroyFixture
internal void DestroyFixture(Body body, bool isBodyDisposing)
{
if (this.fixture == null) return;
if (!isBodyDisposing)
body.DestroyFixture(this.fixture);
this.fixture = null;
}