当前位置: 首页>>代码示例>>C#>>正文


C# Global.ToString方法代码示例

本文整理汇总了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;
        }
开发者ID:PhoenixWright,项目名称:NePlus,代码行数:43,代码来源:EnemyPhysicsComponent.cs

示例2: GetAccessRights

 public GetAccessRightsResult GetAccessRights(string userId, Global.Module module)
 {
     try
     {
         return ctx.GetAccessRights(userId, module.ToString()).ToList<GetAccessRightsResult>().FirstOrDefault();
     }
     catch (Exception)
     {
         throw;
     }
 }
开发者ID:m12k,项目名称:Files,代码行数:11,代码来源:ClassUsers.cs


注:本文中的System.Global.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。