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


C# Serializer.GetDataElement方法代码示例

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


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

示例1: Deserialize

        protected override void Deserialize(Serializer serializer)
        {
            _boneFrameStartValues = GetStateData(serializer.GetDataElement("starting-values"));
            _boneFrameEndValues = GetStateData(serializer.GetDataElement("target-values"));

            foreach (KeyValuePair<string, SkeletalKeyframe.DataContainer> kvp in _boneFrameEndValues)
            {
                if (kvp.Value.Rotation < 0.0f) { kvp.Value.Rotation = _boneFrameStartValues[kvp.Key].Rotation; }
                if (kvp.Value.Scale < 0.0f) { kvp.Value.Rotation = _boneFrameStartValues[kvp.Key].Scale; }
            }

            base.Deserialize(serializer);
        }
开发者ID:Ben-P-Leda,项目名称:Bopscotch-Editor,代码行数:13,代码来源:SkeletalAnimationEngine.cs

示例2: Deserialize

        public void Deserialize(XElement serializedData)
        {
            Serializer serializer = new Serializer(serializedData);
            _settings = serializer.GetDataItem<PhoneSettings>("config-settings");

            _hasRated = serializer.GetDataItem<bool>("has-rated");

            if (serializedData.Elements("dataitem").Any(x => x.Attribute("name").Value == "reminder-plays"))
            {
                _playsBeforeNextReminder = serializer.GetDataItem<int>("reminder-plays");
            }
            else
            {
                _playsBeforeNextReminder = Initial_Plays_Before_Rating_Reminder;
            }
            _nextReminderDate = serializer.GetDataItem<DateTime>("next-reminder");
            _livesElementAdded = serializer.GetDataItem<bool>("lives-added");
            _livesRemaining = serializer.GetDataItem<int>("lives-remaining");
            _lastLivesUpdateTime = serializer.GetDataItem<DateTime>("lives-updated");
            _goldenTicketCount = serializer.GetDataItem<int>("golden-tickets");
            _currentArea = serializer.GetDataItem<string>("last-area");

            LoadAreaDataFromXml(serializer.GetDataElement("survival-area-data"));
            LoadAvatarComponentDataFromXml(serializer.GetDataElement("avatar-component-data"));
        }
开发者ID:Ben-P-Leda,项目名称:Bopscotch-Android,代码行数:25,代码来源:Profile.cs

示例3: Deserialize

        protected virtual void Deserialize(Serializer serializer)
        {
            _currentKeyframeIndex = serializer.GetDataItem<int>("current-frame-index");
            _currentKeyframeMillisecondsElapsed = serializer.GetDataItem<float>("current-frame-elapsed");

            _sequence = new AnimationSequence(serializer.GetDataItem<AnimationSequence.AnimationSequenceType>("sequence-type"));
            _sequence.Loops = serializer.GetDataItem<bool>("loop-sequence");

            XElement frames = serializer.GetDataElement("keyframes");
            if (frames != null)
            {
                foreach (XElement frame in frames.Elements("keyframe")) { _sequence.Keyframes.Add(DeserializeKeyframe(frame)); }
            }
        }
开发者ID:Ben-P-Leda,项目名称:Bopscotch-Android,代码行数:14,代码来源:AnimationEngineBase.cs

示例4: Deserialize

 protected virtual void Deserialize(Serializer serializer)
 {
     RaceName = serializer.GetDataItem<string>("race-name");
     ControlSensitivity = serializer.GetDataItem<float>("control-sensitivity");
     SelectedAvatarSlot = serializer.GetDataItem<int>("selected-avatar");
     MusicManager.Muted = serializer.GetDataItem<bool>("music-off");
     SoundEffectManager.Muted = serializer.GetDataItem<bool>("sound-off");
     ShowPowerUpHelpers = serializer.GetDataItem<bool>("powerup-helpers-on");
     DeserializeAvatarCustomisations(serializer.GetDataElement("avatar-customisations"));
 }
开发者ID:Ben-P-Leda,项目名称:Bopscotch-Android,代码行数:10,代码来源:UniversalSettings.cs


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