本文整理汇总了C#中GenericReader.ReadEntity方法的典型用法代码示例。如果您正苦于以下问题:C# GenericReader.ReadEntity方法的具体用法?C# GenericReader.ReadEntity怎么用?C# GenericReader.ReadEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenericReader
的用法示例。
在下文中一共展示了GenericReader.ReadEntity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadEntity
/*
private IEntity ReadEntity( GenericReader reader )
{
return World.FindEntity( reader.ReadInt() );
}
*/
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_EffectDelay = reader.ReadTimeSpan();
m_TriggerDelay = reader.ReadTimeSpan();
m_SoundDelay = reader.ReadTimeSpan();
m_Source = reader.ReadEntity();
m_Target = reader.ReadEntity();
m_Trigger = reader.ReadItem() as EffectController;
m_FixedDirection = reader.ReadBool();
m_Explodes = reader.ReadBool();
m_PlaySoundAtTrigger = reader.ReadBool();
m_EffectType = (ECEffectType)reader.ReadEncodedInt();
m_EffectLayer = (EffectLayer)reader.ReadEncodedInt();
m_TriggerType = (EffectTriggerType)reader.ReadEncodedInt();
m_ItemID = reader.ReadEncodedInt();
m_Hue = reader.ReadEncodedInt();
m_RenderMode = reader.ReadEncodedInt();
m_Speed = reader.ReadEncodedInt();
m_Duration = reader.ReadEncodedInt();
m_ParticleEffect = reader.ReadEncodedInt();
m_ExplodeParticleEffect = reader.ReadEncodedInt();
m_ExplodeSound = reader.ReadEncodedInt();
m_Unknown = reader.ReadEncodedInt();
m_SoundID = reader.ReadEncodedInt();
m_TriggerRange = reader.ReadEncodedInt();
break;
}
}
}
示例2: UberSpawnerEntry
public UberSpawnerEntry(UberSpawner parent, GenericReader reader)
{
int version = reader.ReadInt();
m_SpawnedName = reader.ReadString();
m_SpawnedProbability = reader.ReadInt();
m_SpawnedMaxCount = reader.ReadInt();
m_Properties = reader.ReadString();
m_Parameters = reader.ReadString();
int count = reader.ReadInt();
m_Spawned = new List<ISpawnable>(count);
for (int i = 0; i < count; ++i)
{
//IEntity e = World.FindEntity( reader.ReadInt() );
ISpawnable e = reader.ReadEntity() as ISpawnable;
if (e != null)
{
e.Spawner = parent;
if (e is BaseCreature)
((BaseCreature)e).RemoveIfUntamed = true;
m_Spawned.Add(e);
if (!parent.Spawned.ContainsKey(e))
parent.Spawned.Add(e, this);
}
}
}