示例#1
0
        public static void InitGlobalMappingData()
        {
            if (AvatarAutoMapper.s_DidPerformInit)
            {
                return;
            }
            List <AvatarAutoMapper.BoneMappingItem> boneMappingItemList = new List <AvatarAutoMapper.BoneMappingItem>((IEnumerable <AvatarAutoMapper.BoneMappingItem>)AvatarAutoMapper.s_MappingDataBody);
            int count = boneMappingItemList.Count;

            for (int index = 0; index < count; ++index)
            {
                AvatarAutoMapper.BoneMappingItem boneMappingItem = boneMappingItemList[index];
                if (boneMappingItem.side == AvatarAutoMapper.Side.Right)
                {
                    int boneIndexFromRight1 = AvatarAutoMapper.GetLeftBoneIndexFromRight(boneMappingItem.bone);
                    int boneIndexFromRight2 = AvatarAutoMapper.GetLeftBoneIndexFromRight(boneMappingItem.parent);
                    boneMappingItemList.Add(new AvatarAutoMapper.BoneMappingItem(boneIndexFromRight2, boneIndexFromRight1, boneMappingItem.minStep, boneMappingItem.maxStep, boneMappingItem.lengthRatio, new Vector3(-boneMappingItem.dir.x, boneMappingItem.dir.y, boneMappingItem.dir.z), AvatarAutoMapper.Side.Left, boneMappingItem.optional, boneMappingItem.alwaysInclude, boneMappingItem.keywords));
                }
            }
            AvatarAutoMapper.s_MappingDataBody = boneMappingItemList.ToArray();
            for (int index = 0; index < AvatarAutoMapper.s_MappingDataBody.Length; ++index)
            {
                AvatarAutoMapper.s_MappingDataBody[index].GetChildren(AvatarAutoMapper.s_MappingDataBody);
            }
            for (int index = 0; index < AvatarAutoMapper.s_LeftMappingDataHand.Length; ++index)
            {
                AvatarAutoMapper.s_LeftMappingDataHand[index].GetChildren(AvatarAutoMapper.s_LeftMappingDataHand);
            }
            for (int index = 0; index < AvatarAutoMapper.s_RightMappingDataHand.Length; ++index)
            {
                AvatarAutoMapper.s_RightMappingDataHand[index].GetChildren(AvatarAutoMapper.s_RightMappingDataHand);
            }
            AvatarAutoMapper.s_DidPerformInit = true;
        }
示例#2
0
        public static void InitGlobalMappingData()
        {
            if (AvatarAutoMapper.s_DidPerformInit)
            {
                return;
            }
            List <AvatarAutoMapper.BoneMappingItem> list = new List <AvatarAutoMapper.BoneMappingItem>(AvatarAutoMapper.s_MappingDataBody);
            int count = list.Count;

            for (int i = 0; i < count; i++)
            {
                AvatarAutoMapper.BoneMappingItem boneMappingItem = list[i];
                if (boneMappingItem.side == AvatarAutoMapper.Side.Right)
                {
                    int leftBoneIndexFromRight  = AvatarAutoMapper.GetLeftBoneIndexFromRight(boneMappingItem.bone);
                    int leftBoneIndexFromRight2 = AvatarAutoMapper.GetLeftBoneIndexFromRight(boneMappingItem.parent);
                    list.Add(new AvatarAutoMapper.BoneMappingItem(leftBoneIndexFromRight2, leftBoneIndexFromRight, boneMappingItem.minStep, boneMappingItem.maxStep, boneMappingItem.lengthRatio, new Vector3(-boneMappingItem.dir.x, boneMappingItem.dir.y, boneMappingItem.dir.z), AvatarAutoMapper.Side.Left, boneMappingItem.optional, boneMappingItem.alwaysInclude, boneMappingItem.keywords));
                }
            }
            AvatarAutoMapper.s_MappingDataBody = list.ToArray();
            for (int j = 0; j < AvatarAutoMapper.s_MappingDataBody.Length; j++)
            {
                AvatarAutoMapper.s_MappingDataBody[j].GetChildren(AvatarAutoMapper.s_MappingDataBody);
            }
            for (int k = 0; k < AvatarAutoMapper.s_LeftMappingDataHand.Length; k++)
            {
                AvatarAutoMapper.s_LeftMappingDataHand[k].GetChildren(AvatarAutoMapper.s_LeftMappingDataHand);
            }
            for (int l = 0; l < AvatarAutoMapper.s_RightMappingDataHand.Length; l++)
            {
                AvatarAutoMapper.s_RightMappingDataHand[l].GetChildren(AvatarAutoMapper.s_RightMappingDataHand);
            }
            AvatarAutoMapper.s_DidPerformInit = true;
        }