当前位置: 首页>>代码示例>>C#>>正文


C# GenericReader.ReadEntity方法代码示例

本文整理汇总了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;
                }
            }
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:48,代码来源:EffectController.cs

示例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);
                }
            }
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:34,代码来源:UberSpawner.cs


注:本文中的GenericReader.ReadEntity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。