本文整理匯總了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;
}
}