Merge branch 'Scripting' into Assets

This commit is contained in:
Axel Galand 2023-01-13 16:47:44 +01:00
commit 68ef2b02fb

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEditor;
using UnityEditor;
using UnityEngine;
namespace Valve.VR
@ -404,9 +399,16 @@ namespace Valve.VR
dest.rightHand.position = source.rightHand.position;
dest.rightHand.rotation = source.rightHand.rotation;
for (int boneIndex = 0; boneIndex < boneNum; boneIndex++)
{
if (boneIndex < dest.rightHand.bonePositions.Length && boneIndex < source.rightHand.bonePositions.Length)
{
dest.rightHand.bonePositions[boneIndex] = source.rightHand.bonePositions[boneIndex];
}
if (boneIndex < dest.rightHand.boneRotations.Length && boneIndex < source.rightHand.boneRotations.Length)
{
dest.rightHand.boneRotations[boneIndex] = source.rightHand.boneRotations[boneIndex];
}
EditorUtility.DisplayProgressBar("Copying...", "Copying right hand pose", (float)boneIndex / (float)boneNum / 2f);
}
dest.rightHand.thumbFingerMovementType = source.rightHand.thumbFingerMovementType;
@ -421,8 +423,14 @@ namespace Valve.VR
dest.leftHand.rotation = source.leftHand.rotation;
for (int boneIndex = 0; boneIndex < boneNum; boneIndex++)
{
dest.leftHand.bonePositions[boneIndex] = source.leftHand.bonePositions[boneIndex];
dest.leftHand.boneRotations[boneIndex] = source.leftHand.boneRotations[boneIndex];
if (boneIndex < dest.rightHand.bonePositions.Length && boneIndex < source.rightHand.bonePositions.Length)
{
dest.rightHand.bonePositions[boneIndex] = source.rightHand.bonePositions[boneIndex];
}
if (boneIndex < dest.rightHand.boneRotations.Length && boneIndex < source.rightHand.boneRotations.Length)
{
dest.rightHand.boneRotations[boneIndex] = source.rightHand.boneRotations[boneIndex];
}
EditorUtility.DisplayProgressBar("Copying...", "Copying left hand pose", (float)boneIndex / (float)boneNum / 2f);
}
dest.leftHand.thumbFingerMovementType = source.leftHand.thumbFingerMovementType;