本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}