public YAMLNode ExportYAML(IExportContainer container) { YAMLMappingNode node = new YAMLMappingNode(); node.AddSerializedVersion(GetSerializedVersion(container.ExportVersion)); node.Add(RootXName, RootX.ExportYAML(container)); node.Add(SkeletonName, Skeleton.ExportYAML(container)); node.Add(SkeletonPoseName, SkeletonPose.ExportYAML(container)); node.Add(LeftHandName, LeftHand.ExportYAML(container)); node.Add(RightHandName, RightHand.ExportYAML(container)); node.Add(HandlesName, GetExportHandles(container.Version).ExportYAML(container)); node.Add(ColliderArrayName, GetExportColliderArray(container.Version).ExportYAML(container)); node.Add(HumanBoneIndexName, HumanBoneIndex.ExportYAML(true)); node.Add(HumanBoneMassName, HumanBoneMass.ExportYAML()); node.Add(ColliderIndexName, GetExportColliderIndex(container.Version).ExportYAML(true)); node.Add(ScaleName, Scale); node.Add(ArmTwistName, ArmTwist); node.Add(ForeArmTwistName, ForeArmTwist); node.Add(UpperLegTwistName, UpperLegTwist); node.Add(LegTwistName, LegTwist); node.Add(ArmStretchName, ArmStretch); node.Add(LegStretchName, LegStretch); node.Add(FeetSpacingName, FeetSpacing); node.Add(HasLeftHandName, HasLeftHand); node.Add(HasRightHandName, HasRightHand); node.Add(HasTDoFName, HasTDoF); return(node); }
public void Read(AssetReader reader) { RootX.Read(reader); Skeleton.Read(reader); SkeletonPose.Read(reader); LeftHand.Read(reader); RightHand.Read(reader); if (IsReadHandles(reader.Version)) { m_handles = reader.ReadArray <Handle>(); m_colliderArray = reader.ReadArray <Collider>(); } m_humanBoneIndex = reader.ReadInt32Array(); m_humanBoneMass = reader.ReadSingleArray(); if (IsReadColliderIndex(reader.Version)) { m_colliderIndex = reader.ReadInt32Array(); } Scale = reader.ReadSingle(); ArmTwist = reader.ReadSingle(); ForeArmTwist = reader.ReadSingle(); UpperLegTwist = reader.ReadSingle(); LegTwist = reader.ReadSingle(); ArmStretch = reader.ReadSingle(); LegStretch = reader.ReadSingle(); FeetSpacing = reader.ReadSingle(); HasLeftHand = reader.ReadBoolean(); HasRightHand = reader.ReadBoolean(); if (IsReadHasTDoF(reader.Version)) { HasTDoF = reader.ReadBoolean(); } reader.AlignStream(AlignType.Align4); }
public YAMLNode ExportYAML(IExportContainer container) { YAMLMappingNode node = new YAMLMappingNode(); node.AddSerializedVersion(GetSerializedVersion(container.Version)); node.Add("m_RootX", RootX.ExportYAML(container)); node.Add("m_Skeleton", Skeleton.ExportYAML(container)); node.Add("m_SkeletonPose", SkeletonPose.ExportYAML(container)); node.Add("m_LeftHand", LeftHand.ExportYAML(container)); node.Add("m_RightHand", RightHand.ExportYAML(container)); node.Add("m_Handles", GetExportHandles(container.Version).ExportYAML(container)); node.Add("m_ColliderArray", GetExportColliderArray(container.Version).ExportYAML(container)); node.Add("m_HumanBoneIndex", HumanBoneIndex.ExportYAML(true)); node.Add("m_HumanBoneMass", HumanBoneMass.ExportYAML()); node.Add("m_ColliderIndex", GetExportColliderIndex(container.Version).ExportYAML(true)); node.Add("m_Scale", Scale); node.Add("m_ArmTwist", ArmTwist); node.Add("m_ForeArmTwist", ForeArmTwist); node.Add("m_UpperLegTwist", UpperLegTwist); node.Add("m_LegTwist", LegTwist); node.Add("m_ArmStretch", ArmStretch); node.Add("m_LegStretch", LegStretch); node.Add("m_FeetSpacing", FeetSpacing); node.Add("m_HasLeftHand", HasLeftHand); node.Add("m_HasRightHand", HasRightHand); node.Add("m_HasTDoF", HasTDoF); return(node); }
public void Read(AssetReader reader) { RootX.Read(reader); Skeleton.Read(reader); SkeletonPose.Read(reader); LeftHand.Read(reader); RightHand.Read(reader); if (HasHandles(reader.Version)) { Handles = reader.ReadAssetArray <Handle>(); ColliderArray = reader.ReadAssetArray <Collider>(); } int[] humanBoneIndex = reader.ReadInt32Array(); HumanBoneIndex = UpdateBoneArray(humanBoneIndex, reader.Version); float[] humanBoneMass = reader.ReadSingleArray(); HumanBoneMass = UpdateBoneArray(humanBoneMass, reader.Version); if (HasColliderIndex(reader.Version)) { int[] colliderIndex = reader.ReadInt32Array(); ColliderIndex = UpdateBoneArray(colliderIndex, reader.Version); } Scale = reader.ReadSingle(); ArmTwist = reader.ReadSingle(); ForeArmTwist = reader.ReadSingle(); UpperLegTwist = reader.ReadSingle(); LegTwist = reader.ReadSingle(); ArmStretch = reader.ReadSingle(); LegStretch = reader.ReadSingle(); FeetSpacing = reader.ReadSingle(); HasLeftHand = reader.ReadBoolean(); HasRightHand = reader.ReadBoolean(); if (HasHasTDoF(reader.Version)) { HasTDoF = reader.ReadBoolean(); } reader.AlignStream(); }