本文整理汇总了C#中System.Runtime.Serialization.SerializationInfo.GetSByte方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationInfo.GetSByte方法的具体用法?C# SerializationInfo.GetSByte怎么用?C# SerializationInfo.GetSByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.Serialization.SerializationInfo
的用法示例。
在下文中一共展示了SerializationInfo.GetSByte方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EntityShape
/// <summary>
/// Called when deserializing
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
protected EntityShape(SerializationInfo info, StreamingContext context)
: base(info, context)
{
_entityClass = info.GetString( "_entityClass" );
_modelFile = info.GetString( "_modelFile" );
// load entity properties
object entityProps = (object) info.GetValue( "_entityProperties", typeof(object) );
_entityProperties = entityProps as DynamicPropertyCollection;
// Store the old property collection data in a member variable (when loading old scene files).
// We'll migrate the property values in the OnDeserialization when all nested properties are fully loaded.
if (_entityProperties == null)
{
_oldEntityProperties = entityProps as CloneableBase;
UpdateEntityProperties(true);
//_entityProperties = EditorManager.EngineManager.EntityClassManager.CreateCollection(this,_entityClass);
}
if (SerializationHelper.HasElement(info,"_bCastStaticShadows"))
_bCastStaticShadows = info.GetBoolean("_bCastStaticShadows");
if (SerializationHelper.HasElement(info,"_bCastDynamicShadows"))
_bCastDynamicShadows = info.GetBoolean("_bCastDynamicShadows");
if (SerializationHelper.HasElement(info,"_vLightGridOfs"))
_vLightGridOfs = (Vector3F)info.GetValue("_vLightGridOfs", typeof(Vector3F));
if (SerializationHelper.HasElement(info,"_iVisibleBitmask"))
_iVisibleBitmask = (FlagsInt32_e)info.GetValue("_iVisibleBitmask", typeof(FlagsInt32_e));
if (SerializationHelper.HasElement(info,"_iLightInfluenceBitmask"))
_iLightInfluenceBitmask = (FlagsInt32_e)info.GetValue("_iLightInfluenceBitmask", typeof(FlagsInt32_e));
// if (SerializationHelper.HasElement(info,"_fLightmapTiling"))
// _fLightmapTiling = info.GetSingle("_fLightmapTiling");
if (SerializationHelper.HasElement(info,"_ambientColor"))
_ambientColor = (Color)info.GetValue("_ambientColor", typeof(Color));
if (SerializationHelper.HasElement(info, "_farClipDistance"))
_farClipDistance = info.GetSingle("_farClipDistance");
if (SerializationHelper.HasElement(info, "_nearClipDistance"))
_nearClipDistance = info.GetSingle("_nearClipDistance");
if (SerializationHelper.HasElement(info, "_renderOrderPriority"))
_renderOrderPriority = info.GetSByte("_renderOrderPriority");
if (SerializationHelper.HasElement(info, "_classDefTemplate"))
_classDefTemplate = info.GetString("_classDefTemplate");
if (SerializationHelper.HasElement(info, "_copySource"))
_copySource = (EntityShape)info.GetValue("_copySource", typeof(EntityShape));
if (SerializationHelper.HasElement(info, "_customMaterialSetName"))
_customMaterialSetName = info.GetString("_customMaterialSetName");
}
示例2: UnitType
private UnitType(SerializationInfo info, StreamingContext c)
{
// Retrieve data from serialization:
int maxindex = 0;
int count = info.GetInt32("count");
int[] tstoreind = new int[count];
sbyte[] tstoreexp = new sbyte[count];
for (int i = 0; i < count; i++)
{
int index = UnitType.GetBaseUnitIndex(info.GetString("name" + i.ToString()));
tstoreind[i] = index;
tstoreexp[i] = info.GetSByte("exp"+i.ToString());
if (index > maxindex) maxindex = index;
}
// Construct instance:
this.baseUnitIndices = new sbyte[maxindex+1];
for (int i = 0; i < count; i++)
{
this.baseUnitIndices[tstoreind[i]] = tstoreexp[i];
}
}