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


C# IValueReader.ReadVector2方法代码示例

本文整理汇总了C#中IValueReader.ReadVector2方法的典型用法代码示例。如果您正苦于以下问题:C# IValueReader.ReadVector2方法的具体用法?C# IValueReader.ReadVector2怎么用?C# IValueReader.ReadVector2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IValueReader的用法示例。


在下文中一共展示了IValueReader.ReadVector2方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Read

 public void Read(IValueReader reader)
 {
     GrhIndex = reader.ReadGrhIndex(_grhIndexValueKey);
     _sourceName = reader.ReadString(_sourceValueKey);
     _destName = reader.ReadString(_destValueKey);
     Offset = reader.ReadVector2(_offsetValueKey);
     Origin = reader.ReadVector2(_originValueKey);
 }
开发者ID:wtfcolt,项目名称:game,代码行数:8,代码来源:SkeletonBodyItemInfo.cs

示例2: BodyInfo

 /// <summary>
 /// Initializes a new instance of the <see cref="BodyInfo"/> class.
 /// </summary>
 /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
 public BodyInfo(IValueReader reader)
 {
     ID = reader.ReadBodyID(_idValueKey);
     Body = reader.ReadString(_bodyValueKey);
     Fall = reader.ReadString(_fallValueKey);
     Jump = reader.ReadString(_jumpValueKey);
     Punch = reader.ReadString(_punchValueKey);
     Stand = reader.ReadString(_standValueKey);
     Walk = reader.ReadString(_walkValueKey);
     Size = reader.ReadVector2(_sizeValueKey);
 }
开发者ID:Vizzini,项目名称:netgore,代码行数:15,代码来源:BodyInfo.cs

示例3: BodyInfo

 /// <summary>
 /// Initializes a new instance of the <see cref="BodyInfo"/> class.
 /// </summary>
 /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
 public BodyInfo(IValueReader reader)
 {
     ID = reader.ReadBodyID(_idValueKey);
     Body = reader.ReadString(_bodyValueKey);
     Fall = reader.ReadString(_fallValueKey);
     Jump = reader.ReadString(_jumpValueKey);
     Attack = reader.ReadString(_attackValueKey);
     Stand = reader.ReadString(_standValueKey);
     Walk = reader.ReadString(_walkValueKey);
     Size = reader.ReadVector2(_sizeValueKey);
     Paperdoll = reader.ReadBool(_paperdollValueKey);
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:16,代码来源:BodyInfo.cs

示例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)
 {
     Position = reader.ReadVector2(_positionKeyName);
     Radius = reader.ReadFloat(_radiusKeyName);
     Strength = reader.ReadFloat(_strengthKeyName);
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:10,代码来源:ParticleRadialGravityModifier.cs

示例5: Read

        /// <summary>
        /// Reads the SkeletonNode's values from an IValueReader.
        /// </summary>
        /// <param name="reader">IValueReader to read the values from.</param>
        /// <returns>The name of the parent SkeletonNode, or null if the SkeletonNode has no parent (root node).
        /// The SkeletonNode's parent must be set manually using this value.</returns>
        public string Read(IValueReader reader)
        {
            Name = reader.ReadString(_nameValueKey);
            Position = reader.ReadVector2(_positionValueKey);
            IsModifier = reader.ReadBool(_isModifierValueKey);
            var hasParent = reader.ReadBool(_hasParentValueKey);

            string parentName = null;
            if (hasParent)
                parentName = reader.ReadString(_parentNameValueKey);

            return parentName;
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:19,代码来源:SkeletonNode.cs

示例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;
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:22,代码来源:Light.cs

示例7: 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);
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:30,代码来源:ParticleEmitter.cs

示例8: Read

        void Read(IValueReader r)
        {
            var position = r.ReadVector2(_positionValueKey);
            var size = r.ReadVector2(_sizeValueKey);
            IsPlatform = r.ReadBool(_isPlatformValueKey);
            BoundGrhIndex = r.ReadGrhIndex(_boundGrhIndexValueKey);

            SetPositionRaw(position);
            SetSizeRaw(size);
        }
开发者ID:wtfcolt,项目名称:game,代码行数:10,代码来源:WallEntityBase.cs

示例9: 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());
        }
开发者ID:Vizzini,项目名称:netgore,代码行数:15,代码来源:BackgroundImage.cs

示例10: DeserializePositionAndVelocity

 /// <summary>
 /// Reads the Position and Velocity from the specified IValueReader. Use in conjunction with
 /// SerializePositionAndVelocity();
 /// </summary>
 /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
 /// <param name="position">The read position value.</param>
 /// <param name="velocity">The read velocity value.</param>
 static void DeserializePositionAndVelocity(IValueReader reader, out Vector2 position, out Vector2 velocity)
 {
     position = reader.ReadVector2(_positionValueKey);
     velocity = reader.ReadVector2(_velocityValueKey);
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:12,代码来源:DynamicEntity.cs

示例11: 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)
 {
     Gravity = reader.ReadVector2(_gravityKeyName);
 }
开发者ID:wtfcolt,项目名称:game,代码行数:8,代码来源:ParticleLinearGravityModifier.cs


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