當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。