本文整理汇总了C#中IValueReader.ReadFloat方法的典型用法代码示例。如果您正苦于以下问题:C# IValueReader.ReadFloat方法的具体用法?C# IValueReader.ReadFloat怎么用?C# IValueReader.ReadFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IValueReader
的用法示例。
在下文中一共展示了IValueReader.ReadFloat方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadCustomValues
/// <summary>
/// Reads the <see cref="ParticleModifier"/>'s custom values from the <see cref="reader"/>.
/// </summary>
/// <param name="reader"><see cref="IValueReader"/> to read the custom values from.</param>
protected override void ReadCustomValues(IValueReader reader)
{
Rate = reader.ReadFloat(_rateKeyName);
}
示例2: ReadCustomValues
/// <summary>
/// Reads the <see cref="ParticleModifier"/>'s custom values from the <see cref="reader"/>.
/// </summary>
/// <param name="reader"><see cref="IValueReader"/> to read the custom values from.</param>
protected override void ReadCustomValues(IValueReader reader)
{
Position = reader.ReadVector2(_positionKeyName);
Radius = reader.ReadFloat(_radiusKeyName);
Strength = reader.ReadFloat(_strengthKeyName);
}
示例3: ReadCustomValues
/// <summary>
/// When overridden in the derived class, reads all custom state values from the <paramref name="reader"/>.
/// </summary>
/// <param name="reader">The <see cref="IValueReader"/> to read the state values from.</param>
protected override void ReadCustomValues(IValueReader reader)
{
Closed = reader.ReadBool(_closedKeyName);
Scale = reader.ReadFloat(_scaleKeyName);
Rotation = reader.ReadFloat(_rotationKeyName);
PolygonOrigin = reader.ReadEnum<PolygonOrigin>(_polygonOriginKeyName);
Points.Read(_pointsNodeName, reader);
}
示例4: ReadCustomValues
/// <summary>
/// Reads the <see cref="ParticleModifier"/>'s custom values from the <see cref="reader"/>.
/// </summary>
/// <param name="reader"><see cref="IValueReader"/> to read the custom values from.</param>
protected override void ReadCustomValues(IValueReader reader)
{
InitialScale = reader.ReadFloat(_initialScaleKeyName);
UltimateScale = reader.ReadFloat(_ultimateScaleKeyName);
}
示例5: ReadValue
/// <summary>
/// When overridden in the derived class, reads the underlying value from the <paramref name="reader"/>.
/// </summary>
/// <param name="reader">The IValueReader to read from.</param>
/// <param name="valueName">The name to of the value in the <paramref name="reader"/>.</param>
protected override void ReadValue(IValueReader reader, string valueName)
{
_value = reader.ReadFloat(valueName);
}
示例6: ReadState
/// <summary>
/// Reads the state of the object from an <see cref="IValueReader"/>. Values should be read in the exact
/// same order as they were written.
/// </summary>
/// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
public void ReadState(IValueReader reader)
{
PositionProvider = null;
Tag = null;
Position = reader.ReadVector2(_positionValueKey);
Size = reader.ReadVector2(_sizeValueKey);
Color = reader.ReadColor(_colorValueKey);
Rotation = reader.ReadFloat(_rotationValueKey);
IsEnabled = reader.ReadBool(_isEnabledValueKey);
var grhIndex = reader.ReadGrhIndex(_spriteValueKey);
if (!grhIndex.IsInvalid)
Sprite = new Grh(grhIndex, AnimType.Loop, 0);
else
Sprite = null;
}
示例7: Read
/// <summary>
/// Reads the <see cref="SkeletonFrame"/> from an <see cref="IValueReader"/>.
/// </summary>
/// <param name="reader">The <see cref="IValueReader"/> to read from.</param>
/// <param name="contentPath">The <see cref="ContentPaths"/> to use to load additional assets.</param>
public void Read(IValueReader reader, ContentPaths contentPath)
{
_delay = reader.ReadFloat(_delayValueKey);
_fileName = reader.ReadString(_fileNameValueKey);
_skeleton = new Skeleton(_fileName, contentPath);
}
示例8: Read
/// <summary>
/// Reads the <see cref="BackgroundImage"/> from an <see cref="IValueReader"/>.
/// </summary>
/// <param name="reader">The <see cref="IValueReader"/> to read from.</param>
protected virtual void Read(IValueReader reader)
{
Name = reader.ReadString(_valueKeyName);
Alignment = reader.ReadEnum<Alignment>(_valueKeyAlignment);
Color = reader.ReadColor(_valueKeyColor);
Depth = reader.ReadFloat(_valueKeyDepth);
Offset = reader.ReadVector2(_valueKeyOffset);
var grhIndex = reader.ReadGrhIndex(_valueKeyGrhIndex);
_sprite = new Grh(grhIndex, AnimType.Loop, Map.GetTime());
}
示例9: TestXmlValueReader
static void TestXmlValueReader(IValueReader reader)
{
Assert.AreEqual(10, reader.ReadInt("MyInt"));
Assert.AreEqual(25.55f, reader.ReadFloat("MyFloat"));
Assert.AreEqual("Hello!", reader.ReadString("MyString"));
}
示例10: ReadCustomValues
/// <summary>
/// When overridden in the derived class, reads all custom state values from the <paramref name="reader"/>.
/// </summary>
/// <param name="reader">The <see cref="IValueReader"/> to read the state values from.</param>
protected override void ReadCustomValues(IValueReader reader)
{
ConeAngle = reader.ReadFloat(_coneAngleKeyName);
Direction = reader.ReadFloat(_directionKeyName);
}
示例11: ReadCustomValues
/// <summary>
/// When overridden in the derived class, reads all custom state values from the <paramref name="reader"/>.
/// </summary>
/// <param name="reader">The <see cref="IValueReader"/> to read the state values from.</param>
protected override void ReadCustomValues(IValueReader reader)
{
Angle = reader.ReadFloat(_angleKeyName);
EmitBothWays = reader.ReadBool(_emitBothWaysKeyName);
Length = reader.ReadInt(_lengthKeyName);
Rectilinear = reader.ReadBool(_rectilinearKeyName);
}