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


C# Entity.CreateProperty方法代碼示例

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


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

示例1: CreateProperties

        public override void CreateProperties(Entity.InitialisationContext context)
        {
            this.texture = context.CreateProperty<TextureCube>("texture");
            this.brightness = context.CreateProperty<float>("brightness");
            this.gammaCorrect = context.CreateProperty<bool>("gamma_correct");

            base.CreateProperties(context);
        }
開發者ID:Quantumplation,項目名稱:Myre,代碼行數:8,代碼來源:Skybox.cs

示例2: CreateProperties

        public override void CreateProperties(Entity.InitialisationContext context)
        {
            this.skyColour = context.CreateProperty<Vector3>("sky_colour");
            this.groundColour = context.CreateProperty<Vector3>("ground_colour");
            this.up = context.CreateProperty<Vector3>("up");

            base.CreateProperties(context);
        }
開發者ID:TomGillen,項目名稱:Myre,代碼行數:8,代碼來源:AmbientLight.cs

示例3: CreateProperties

        public override void CreateProperties(Entity.ConstructionContext context)
        {
            base.CreateProperties(context);

            _string = context.CreateProperty(StringName, "");
            _font = context.CreateProperty(FontName);
            _model = context.CreateProperty(ModelInstance.ModelName);
            _thickness = context.CreateProperty(ThicknessName);
        }
開發者ID:xoxota99,項目名稱:Myre,代碼行數:9,代碼來源:StringModelData.cs

示例4: CreateProperties

        public override void CreateProperties(Entity.ConstructionContext context)
        {
            Property<float> mass = context.CreateProperty<float>(MASS);
            Property<float> invMass = context.CreateProperty<float>(INVERSE_MASS);

            mass.PropertySet += (p, o, n) => { invMass.Value = 1 / mass.Value; };

            //trigger the changed property to initialise inverse mass to a useful value
            mass.Value = mass.Value;

            base.CreateProperties(context);
        }
開發者ID:ylyking,項目名稱:Myre,代碼行數:12,代碼來源:InverseMassCalculator.cs

示例5: CreateProperties

        public override void CreateProperties(Entity.InitialisationContext context)
        {
            var prefix = Name != null ? Name + "_" : string.Empty;
            radius = context.CreateProperty<float>(prefix + "radius");
            centre = context.CreateProperty<Vector2>(prefix + "centre");
            transform = context.CreateProperty<Matrix>("transform", Matrix.Identity);

            radius.PropertyChanged += _ => UpdateBounds();
            centre.PropertyChanged += _ => UpdateBounds();
            transform.PropertyChanged += _ => UpdateBounds();

            base.CreateProperties(context);
        }
開發者ID:Quantumplation,項目名稱:Myre,代碼行數:13,代碼來源:Circle.cs

示例6: CreateProperties

        public override void CreateProperties(Entity.ConstructionContext context)
        {
            var prefix = Name != null ? Name + "_" : string.Empty;
            _transformProperty = context.CreateProperty<Matrix>("transform", Matrix.Identity);
            _verticesProperty = context.CreateProperty<Vector2[]>(prefix + "vertices");

            _transformProperty.PropertySet += (p, o, n) => ApplyTransform();
            _verticesProperty.PropertySet += (p, o, n) => ReadVertices(p);

            base.CreateProperties(context);
        }
開發者ID:ylyking,項目名稱:Myre,代碼行數:11,代碼來源:Polygon.cs

示例7: CreateProperties

 public override void CreateProperties(Entity.ConstructionContext context)
 {
     _defaultClip = context.CreateProperty(DefaultClipName);
     _rootBoneTransform = context.CreateProperty(RootTransformName, Transform.Identity);
     _enableRootBoneTranslationX = context.CreateProperty(RootTranslationXName, false);
     _enableRootBoneTranslationY = context.CreateProperty(RootTranslationYName, false);
     _enableRootBoneTranslationZ = context.CreateProperty(RootTranslationZName, false);
     _enableRootBoneRotation = context.CreateProperty(EnableRootRotationName, true);
     _enableRootBoneScale = context.CreateProperty(EnableRootScaleName, true);
 }
開發者ID:ylyking,項目名稱:Myre,代碼行數:10,代碼來源:AnimationQueue.cs

示例8: CreateProperties

        public override void CreateProperties(Entity.InitialisationContext context)
        {
            var prefix = Name != null ? Name + "_" : string.Empty;
            transformProperty = context.CreateProperty<Matrix>("transform", Matrix.Identity);
            verticesProperty = context.CreateProperty<Vector2[]>(prefix + "vertices");

            transformProperty.PropertyChanged += p => ApplyTransform();
            verticesProperty.PropertyChanged += p => ReadVertices(p);

            base.CreateProperties(context);
        }
開發者ID:Quantumplation,項目名稱:Myre,代碼行數:11,代碼來源:Polygon.cs

示例9: CreateProperties

        public override void CreateProperties(Entity.ConstructionContext context)
        {
            _frictionCoefficient = context.CreateProperty(new TypedName<float>("friction_coefficient"), default(float));
            _restitutionCoefficient = context.CreateProperty(new TypedName<float>("restitution_coefficient"), default(float));
            _sleeping = context.CreateProperty(new TypedName<bool>("sleeping"), default(bool));
            _group = context.CreateProperty(new TypedName<CollisionGroup>("collision_group"), default(CollisionGroup));

            _restitutionCoefficient.PropertySet += ValidateRestitution;
            _sleeping.PropertySet += WakeUp;

            base.CreateProperties(context);
        }
開發者ID:ylyking,項目名稱:Myre,代碼行數:12,代碼來源:Geometry.cs

示例10: CreateProperties

        public override void CreateProperties(Entity.InitialisationContext context)
        {
            this.colour = context.CreateProperty<Vector3>("colour");
            this.position = context.CreateProperty<Vector3>("position");
            this.direction = context.CreateProperty<Vector3>("direction");
            this.angle = context.CreateProperty<float>("angle");
            this.range = context.CreateProperty<float>("range");
            this.mask = context.CreateProperty<Texture2D>("mask");
            this.shadowResolution = context.CreateProperty<int>("shadow_resolution");

            base.CreateProperties(context);
        }
開發者ID:Quantumplation,項目名稱:Myre,代碼行數:12,代碼來源:SpotLight.cs


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