本文整理汇总了C#中IValueReader.ReadVariableUShort方法的典型用法代码示例。如果您正苦于以下问题:C# IValueReader.ReadVariableUShort方法的具体用法?C# IValueReader.ReadVariableUShort怎么用?C# IValueReader.ReadVariableUShort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IValueReader
的用法示例。
在下文中一共展示了IValueReader.ReadVariableUShort方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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)
{
// Read the primary values
Name = reader.ReadString(_nameKeyName);
BlendMode = reader.ReadEnum<BlendMode>(_blendModeKeyName);
Budget = reader.ReadInt(_budgetKeyName);
EmitterLife = reader.ReadInt(_emitterLifeKeyName);
ParticleLife = reader.ReadVariableInt(_particleLifeKeyName);
Origin = reader.ReadVector2(_originKeyName);
ReleaseAmount = reader.ReadVariableUShort(_releaseAmountKeyName);
ReleaseColor = reader.ReadVariableColor(_releaseColorKeyName);
ReleaseRate = reader.ReadVariableUShort(_releaseRateKeyName);
ReleaseRotation = reader.ReadVariableFloat(_releaseRotationKeyName);
ReleaseScale = reader.ReadVariableFloat(_releaseScaleKeyName);
ReleaseSpeed = reader.ReadVariableFloat(_releaseSpeedKeyName);
Sprite.SetGrh(reader.ReadGrhIndex(_grhIndexKeyName));
// Read the custom values
var customValuesReader = reader.ReadNode(_customValuesNodeName);
ReadCustomValues(customValuesReader);
// Read the modifier collection
ParticleModifiers.Read(_particleModifiersNodeName, reader);
EmitterModifiers.Read(_emitterModifiersNodeName, reader);
}