public AvatarConstant(ObjectReader reader) { var version = reader.version; m_AvatarSkeleton = new Skeleton(reader); m_AvatarSkeletonPose = new SkeletonPose(reader); if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up { m_DefaultPose = new SkeletonPose(reader); m_SkeletonNameIDArray = reader.ReadUInt32Array(); } m_Human = new Human(reader); m_HumanSkeletonIndexArray = reader.ReadInt32Array(); if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up { m_HumanSkeletonReverseIndexArray = reader.ReadInt32Array(); } m_RootMotionBoneIndex = reader.ReadInt32(); m_RootMotionBoneX = new xform(reader); if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up { m_RootMotionSkeleton = new Skeleton(reader); m_RootMotionSkeletonPose = new SkeletonPose(reader); m_RootMotionSkeletonIndexArray = reader.ReadInt32Array(); } }
public AvatarConstant(ObjectReader reader) { var version = reader.version; m_AvatarSkeleton = new Skeleton(reader); m_AvatarSkeletonPose = new SkeletonPose(reader); if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up { m_DefaultPose = new SkeletonPose(reader); int numIDs = reader.ReadInt32(); m_SkeletonNameIDArray = new List <uint>(numIDs); for (int i = 0; i < numIDs; i++) { m_SkeletonNameIDArray.Add(reader.ReadUInt32()); } } m_Human = new Human(reader); int numIndexes = reader.ReadInt32(); m_HumanSkeletonIndexArray = new List <int>(numIndexes); for (int i = 0; i < numIndexes; i++) { m_HumanSkeletonIndexArray.Add(reader.ReadInt32()); } if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up { int numReverseIndexes = reader.ReadInt32(); m_HumanSkeletonReverseIndexArray = new List <int>(numReverseIndexes); for (int i = 0; i < numReverseIndexes; i++) { m_HumanSkeletonReverseIndexArray.Add(reader.ReadInt32()); } } m_RootMotionBoneIndex = reader.ReadInt32(); m_RootMotionBoneX = new xform(reader); if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up { m_RootMotionSkeleton = new Skeleton(reader); m_RootMotionSkeletonPose = new SkeletonPose(reader); int numMotionIndexes = reader.ReadInt32(); m_RootMotionSkeletonIndexArray = new List <int>(numMotionIndexes); for (int i = 0; i < numMotionIndexes; i++) { m_RootMotionSkeletonIndexArray.Add(reader.ReadInt32()); } } }
public Human(ObjectReader reader) { var version = reader.version; m_RootX = new xform(reader); m_Skeleton = new Skeleton(reader); m_SkeletonPose = new SkeletonPose(reader); m_LeftHand = new Hand(reader); m_RightHand = new Hand(reader); if (version[0] < 2018 || (version[0] == 2018 && version[1] < 2)) //2018.2 down { var numHandles = reader.ReadInt32(); m_Handles = new Handle[numHandles]; for (var i = 0; i < numHandles; i++) { m_Handles[i] = new Handle(reader); } var numColliders = reader.ReadInt32(); m_ColliderArray = new Collider[numColliders]; for (var i = 0; i < numColliders; i++) { m_ColliderArray[i] = new Collider(reader); } } m_HumanBoneIndex = reader.ReadInt32Array(); m_HumanBoneMass = reader.ReadSingleArray(); if (version[0] < 2018 || (version[0] == 2018 && version[1] < 2)) //2018.2 down { m_ColliderIndex = reader.ReadInt32Array(); } m_Scale = reader.ReadSingle(); m_ArmTwist = reader.ReadSingle(); m_ForeArmTwist = reader.ReadSingle(); m_UpperLegTwist = reader.ReadSingle(); m_LegTwist = reader.ReadSingle(); m_ArmStretch = reader.ReadSingle(); m_LegStretch = reader.ReadSingle(); m_FeetSpacing = reader.ReadSingle(); m_HasLeftHand = reader.ReadBoolean(); m_HasRightHand = reader.ReadBoolean(); if (version[0] > 5 || (version[0] == 5 && version[1] >= 2)) //5.2 and up { m_HasTDoF = reader.ReadBoolean(); } reader.AlignStream(); }
public Human(ObjectReader reader) { var version = reader.version; m_RootX = new xform(reader); m_Skeleton = new Skeleton(reader); m_SkeletonPose = new SkeletonPose(reader); m_LeftHand = new Hand(reader); m_RightHand = new Hand(reader); if (version[0] < 2018 || (version[0] == 2018 && version[1] < 2)) //2018.2 down { int numHandles = reader.ReadInt32(); m_Handles = new List <Handle>(numHandles); for (int i = 0; i < numHandles; i++) { m_Handles.Add(new Handle(reader)); } int numColliders = reader.ReadInt32(); m_ColliderArray = new List <Collider>(numColliders); for (int i = 0; i < numColliders; i++) { m_ColliderArray.Add(new Collider(reader)); } } m_HumanBoneIndex = reader.ReadInt32Array(); m_HumanBoneMass = reader.ReadSingleArray(); if (version[0] < 2018 || (version[0] == 2018 && version[1] < 2)) //2018.2 down { m_ColliderIndex = reader.ReadInt32Array(); } m_Scale = reader.ReadSingle(); m_ArmTwist = reader.ReadSingle(); m_ForeArmTwist = reader.ReadSingle(); m_UpperLegTwist = reader.ReadSingle(); m_LegTwist = reader.ReadSingle(); m_ArmStretch = reader.ReadSingle(); m_LegStretch = reader.ReadSingle(); m_FeetSpacing = reader.ReadSingle(); m_HasLeftHand = reader.ReadBoolean(); m_HasRightHand = reader.ReadBoolean(); m_HasTDoF = reader.ReadBoolean(); reader.AlignStream(); }