當前位置: 首頁>>代碼示例>>C#>>正文


C# Collision.LinkDependency方法代碼示例

本文整理匯總了C#中Collision.LinkDependency方法的典型用法代碼示例。如果您正苦於以下問題:C# Collision.LinkDependency方法的具體用法?C# Collision.LinkDependency怎麽用?C# Collision.LinkDependency使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Collision的用法示例。


在下文中一共展示了Collision.LinkDependency方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: BaseNode

        public BaseNode(Node parent, string name)
            : base(parent, name)
        {
            Body = new Body(this, "Body");

            Physics = new Physics(this, "Physics");
            Physics.LinkDependency(Physics.DEPENDENCY_BODY, Body);

            Collision = new Collision(this, "Collision");
            Collision.LinkDependency(Collision.DEPENDENCY_PHYSICS, Physics);
        }
開發者ID:redcodefinal,項目名稱:EntityEngineV4TestBed,代碼行數:11,代碼來源:BaseNode.cs

示例2: CollisionTestNode

            /// <summary>
            /// /Creates a new AABBEntity
            /// </summary>
            /// <param name="stateref"></param>
            /// <param name="name"></param>
            public CollisionTestNode(State stateref, string name)
                : base(stateref, name)
            {
                Body = new Body(this, "Body");

                Physics = new Physics(this, "Physics");
                Physics.LinkDependency(Physics.DEPENDENCY_BODY, Body);

                Collision = new Collision(this, "Collision");
                Collision.LinkDependency(Collision.DEPENDENCY_PHYSICS, Physics);

                ImageRender = new ImageRender(this, "Image", Assets.Pixel);
                ImageRender.LinkDependency(ImageRender.DEPENDENCY_BODY, Body);

                TextBody = new Body(this, "TextBody");

                TextRender = new TextRender(this, "Render");
                TextRender.LinkDependency(TextRender.DEPENDENCY_BODY, TextBody);
            }
開發者ID:redcodefinal,項目名稱:EntityEngineV4TestBed,代碼行數:24,代碼來源:CollisionTestState.cs

示例3: ResolutionTestNode

            public ResolutionTestNode(State stateref, string name)
                : base(stateref, name)
            {
                Body = new Body(this, "Body");
                Body.Bounds = new Vector2(70, 70);

                _physics = new Physics(this, "_physics");
                _physics.LinkDependency(Physics.DEPENDENCY_BODY, Body);
                _physics.Mass = 10f;
                _physics.Restitution = 1f;
                _physics.Drag = .95f;

                Shape = new AABB(this, "AABB");
                Shape.LinkDependency(AABB.DEPENDENCY_BODY, Body);

                Collision = new Collision(this, "Collision");
                Collision.LinkDependency(Collision.DEPENDENCY_SHAPE, Shape);
                Collision.LinkDependency(Collision.DEPENDENCY_PHYSICS, _physics);
                Collision.Initialize();

                _imageRender = new ImageRender(this, "Image", Assets.Pixel);
                _imageRender.LinkDependency(ImageRender.DEPENDENCY_BODY, Body);
                _imageRender.Scale = new Vector2(70, 70);
                _imageRender.Layer = .5f;

                _textBody = new Body(this, "_textBody");

                _textRender = new TextRender(this, "_textRender");
                _textRender.LinkDependency(TextRender.DEPENDENCY_BODY, _textBody);
                _textRender.Color = Color.White;
                _textRender.Font = Assets.Font;
                _textRender.Text = Name;
                _textRender.Layer = 1f;
            }
開發者ID:redcodefinal,項目名稱:EntityEngineV4TestBed,代碼行數:34,代碼來源:ResolutionTestState.cs

示例4: TestEntity

            public TestEntity(Node parent, string name)
                : base(parent, name)
            {
                Body = new Body(this, "Body");

                Physics = new Physics(this, "Physics");
                Physics.Mass = 10;
                Physics.LinkDependency(Physics.DEPENDENCY_BODY, Body);

                Collision = new Collision(this, "Collision");
                Collision.Group.AddMask(0);
                Collision.Pair.AddMask(0);
                Collision.ResolutionGroup.AddMask(0);
                Collision.LinkDependency(Collision.DEPENDENCY_PHYSICS, Physics);
            }
開發者ID:redcodefinal,項目名稱:EntityEngineV4TestBed,代碼行數:15,代碼來源:CollisionResolutionTest.cs


注:本文中的Collision.LinkDependency方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。