mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
move bunch of things to depricated folder
This commit is contained in:
parent
86828a94e2
commit
21f8893095
156 changed files with 193 additions and 93 deletions
40
.DepricatedMods/InteractionTest/GrabbableAvatar.cs
Normal file
40
.DepricatedMods/InteractionTest/GrabbableAvatar.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using ABI_RC.Core;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.InteractionTest;
|
||||
|
||||
internal class GrabbableAvatar : MonoBehaviour
|
||||
{
|
||||
private static readonly HumanBodyBones[][] boneSequences = new[]
|
||||
{
|
||||
new[] { HumanBodyBones.Hips, HumanBodyBones.Spine, HumanBodyBones.Chest, HumanBodyBones.Neck, HumanBodyBones.Head },
|
||||
new[] { HumanBodyBones.LeftUpperLeg, HumanBodyBones.LeftLowerLeg, HumanBodyBones.LeftFoot },
|
||||
new[] { HumanBodyBones.RightUpperLeg, HumanBodyBones.RightLowerLeg, HumanBodyBones.RightFoot },
|
||||
new[] { HumanBodyBones.LeftUpperArm, HumanBodyBones.LeftLowerArm, HumanBodyBones.LeftHand },
|
||||
new[] { HumanBodyBones.RightUpperArm, HumanBodyBones.RightLowerArm, HumanBodyBones.RightHand }
|
||||
};
|
||||
|
||||
private void Start()
|
||||
{
|
||||
var animator = GetComponent<Animator>();
|
||||
|
||||
for (int seqIndex = 0; seqIndex < boneSequences.Length; seqIndex++)
|
||||
{
|
||||
var boneSequence = boneSequences[seqIndex];
|
||||
|
||||
for (int i = 0; i < boneSequence.Length - 1; i++)
|
||||
{
|
||||
var fromBone = animator.GetBoneTransform(boneSequence[i]);
|
||||
var toBone = animator.GetBoneTransform(boneSequence[i + 1]);
|
||||
|
||||
var colliderName = new StringBuilder(fromBone.name)
|
||||
.Append("_to_")
|
||||
.Append(toBone.name)
|
||||
.ToString();
|
||||
|
||||
CVRTools.GenerateBoneCollider(fromBone, toBone, 1f, colliderName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue