本文整理汇总了C#中System.Global.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Global.ToString方法的具体用法?C# Global.ToString怎么用?C# Global.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Global
的用法示例。
在下文中一共展示了Global.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnemyPhysicsComponent
public EnemyPhysicsComponent(Engine engine, Vector2 gameWorldPosition, Global.Shapes shape)
: base(engine)
{
switch (shape)
{
case Global.Shapes.Circle:
MainFixture = FixtureFactory.CreateCircle(Engine.Physics.World, 0.25f, 1.0f);
MainFixture.Friction = 0.5f;
break;
case Global.Shapes.Player:
MainFixture = FixtureFactory.CreateRectangle(Engine.Physics.World, 0.5f, 0.5f, 1);
Bodies.Add(MainFixture.Body);
MainFixture.Body.Position = Engine.Physics.PositionToPhysicsWorld(gameWorldPosition);
MainFixture.Body.BodyType = BodyType.Dynamic;
MainFixture.Body.SleepingAllowed = false;
Fixture WheelFixture = FixtureFactory.CreateCircle(Engine.Physics.World, 0.3f, 1.0f);
Bodies.Add(WheelFixture.Body);
WheelFixture.Body.Position = MainFixture.Body.Position + new Vector2(0.0f, 0.6f);
WheelFixture.Body.BodyType = BodyType.Dynamic;
WheelFixture.Body.SleepingAllowed = false;
WheelFixture.Friction = 0.5f;
FixedAngleJoint playerFAJ = JointFactory.CreateFixedAngleJoint(Engine.Physics.World, MainFixture.Body);
playerFAJ.BodyB = WheelFixture.Body;
RevoluteJoint wheelMotorRevJoint = JointFactory.CreateRevoluteJoint(MainFixture.Body, WheelFixture.Body, Vector2.Zero);
wheelMotorRevJoint.MaxMotorTorque = 10.0f;
wheelMotorRevJoint.MotorEnabled = true;
Engine.Physics.World.AddJoint(wheelMotorRevJoint);
break;
case Global.Shapes.Square:
MainFixture = FixtureFactory.CreateRectangle(Engine.Physics.World, 0.5f, 0.5f, 1.0f);
break;
default:
throw new Exception("shape " + shape.ToString() + " not recognized when creating EnemyPhysicsComponent");
}
Bodies.Add(MainFixture.Body);
MainFixture.Body.Position = Engine.Physics.PositionToPhysicsWorld(gameWorldPosition);
MainFixture.Body.BodyType = BodyType.Dynamic;
}
示例2: GetAccessRights
public GetAccessRightsResult GetAccessRights(string userId, Global.Module module)
{
try
{
return ctx.GetAccessRights(userId, module.ToString()).ToList<GetAccessRightsResult>().FirstOrDefault();
}
catch (Exception)
{
throw;
}
}