Exemple #1
0
		public override void Read(AssetReader reader)
		{
			base.Read(reader);

			Center.Read(reader);
			Radius = reader.ReadSingle();
			if (HasSuspensionSpringFirst(reader.Version))
			{
				SuspensionSpring.Read(reader);
			}
			SuspensionDistance = reader.ReadSingle();
			if (!HasSuspensionSpringFirst(reader.Version))
			{
				SuspensionSpring.Read(reader);
			}
			if (HasForceAppPointDistance(reader.Version))
			{
				ForceAppPointDistance = reader.ReadSingle();
			}
			Mass = reader.ReadSingle();
			if (HasWheelDampingRate(reader.Version))
			{
				WheelDampingRate = reader.ReadSingle();
			}
			ForwardFriction.Read(reader);
			SidewaysFriction.Read(reader);
			if (HasEnabled(reader.Version))
			{
				Enabled = reader.ReadBoolean();
				reader.AlignStream();
			}
		}
Exemple #2
0
        public override void Read(AssetStream stream)
        {
            base.Read(stream);

            Center.Read(stream);
            Radius = stream.ReadSingle();
            if (IsReadSuspensionSpringFirst(stream.Version))
            {
                SuspensionSpring.Read(stream);
            }
            SuspensionDistance = stream.ReadSingle();
            if (!IsReadSuspensionSpringFirst(stream.Version))
            {
                SuspensionSpring.Read(stream);
            }
            if (IsReadForceAppPointDistance(stream.Version))
            {
                ForceAppPointDistance = stream.ReadSingle();
            }
            Mass = stream.ReadSingle();
            if (IsReadWheelDampingRate(stream.Version))
            {
                WheelDampingRate = stream.ReadSingle();
            }
            ForwardFriction.Read(stream);
            SidewaysFriction.Read(stream);
            if (IsReadEnabled(stream.Version))
            {
                Enabled = stream.ReadBoolean();
                stream.AlignStream(AlignType.Align4);
            }
        }
Exemple #3
0
		protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
		{
			YAMLMappingNode node = base.ExportYAMLRoot(container);
			node.Add(CenterName, Center.ExportYAML(container));
			node.Add(RadiusName, Radius);
			node.Add(SuspensionSpringName, SuspensionSpring.ExportYAML(container));
			node.Add(SuspensionDistanceName, SuspensionDistance);
			node.Add(ForceAppPointDistanceName, ForceAppPointDistance);
			node.Add(MassName, Mass);
			node.Add(WheelDampingRateName, WheelDampingRate);
			node.Add(ForwardFrictionName, ForwardFriction.ExportYAML(container));
			node.Add(SidewaysFrictionName, SidewaysFriction.ExportYAML(container));
			node.Add(EnabledName, Enabled);
			return node;
		}
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(container);

            node.Add("m_Center", Center.ExportYAML(container));
            node.Add("m_Radius", Radius);
            node.Add("m_SuspensionSpring", SuspensionSpring.ExportYAML(container));
            node.Add("m_SuspensionDistance", SuspensionDistance);
            node.Add("m_ForceAppPointDistance", ForceAppPointDistance);
            node.Add("m_Mass", Mass);
            node.Add("m_WheelDampingRate", WheelDampingRate);
            node.Add("m_ForwardFriction", ForwardFriction.ExportYAML(container));
            node.Add("m_SidewaysFriction", SidewaysFriction.ExportYAML(container));
            node.Add("m_Enabled", Enabled);
            return(node);
        }