mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
Move many mods to Deprecated folder, fix spelling
This commit is contained in:
parent
5e822cec8d
commit
0042590aa6
539 changed files with 7475 additions and 3120 deletions
68
.Deprecated/InteractionTest/AutoArmIK.cs
Normal file
68
.Deprecated/InteractionTest/AutoArmIK.cs
Normal file
|
@ -0,0 +1,68 @@
|
|||
using UnityEngine;
|
||||
using RootMotion.FinalIK;
|
||||
|
||||
namespace NAK.InteractionTest;
|
||||
|
||||
public class AutoArmIK : MonoBehaviour
|
||||
{
|
||||
public bool calibrateOnStart = true;
|
||||
public Transform leftHand, rightHand;
|
||||
|
||||
Animator animator;
|
||||
ArmIK leftArmIK, rightArmIK;
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (calibrateOnStart) CalibrateArmIK();
|
||||
}
|
||||
|
||||
public void CalibrateArmIK()
|
||||
{
|
||||
animator = GetComponent<Animator>();
|
||||
if (animator == null)
|
||||
{
|
||||
Debug.LogError("Animator component not found on the avatar.");
|
||||
return;
|
||||
}
|
||||
|
||||
leftArmIK = gameObject.AddComponent<ArmIK>();
|
||||
leftArmIK.solver.isLeft = true;
|
||||
rightArmIK = gameObject.AddComponent<ArmIK>();
|
||||
rightArmIK.solver.isLeft = false;
|
||||
|
||||
CreateHandTarget(HumanBodyBones.LeftHand, ref leftHand);
|
||||
CreateHandTarget(HumanBodyBones.RightHand, ref rightHand);
|
||||
|
||||
leftArmIK.solver.arm.target = leftHand;
|
||||
rightArmIK.solver.arm.target = rightHand;
|
||||
|
||||
SetArmIKChain(leftArmIK, HumanBodyBones.LeftShoulder, HumanBodyBones.LeftUpperArm, HumanBodyBones.LeftLowerArm, HumanBodyBones.LeftHand);
|
||||
SetArmIKChain(rightArmIK, HumanBodyBones.RightShoulder, HumanBodyBones.RightUpperArm, HumanBodyBones.RightLowerArm, HumanBodyBones.RightHand);
|
||||
|
||||
leftArmIK.solver.IKPositionWeight = 1f;
|
||||
rightArmIK.solver.IKPositionWeight = 1f;
|
||||
}
|
||||
|
||||
private void CreateHandTarget(HumanBodyBones bone, ref Transform handTarget)
|
||||
{
|
||||
var boneTransform = animator.GetBoneTransform(bone);
|
||||
var handGO = new GameObject($"{boneTransform.name} Target");
|
||||
handTarget = handGO.transform;
|
||||
handTarget.position = boneTransform.position;
|
||||
|
||||
Vector3 sourceYWorld = boneTransform.TransformDirection(Vector3.up);
|
||||
handTarget.rotation = Quaternion.LookRotation(boneTransform.forward, sourceYWorld);
|
||||
}
|
||||
|
||||
private void SetArmIKChain(ArmIK armIK, HumanBodyBones shoulder, HumanBodyBones upperArm, HumanBodyBones lowerArm, HumanBodyBones hand)
|
||||
{
|
||||
armIK.solver.SetChain(
|
||||
animator.GetBoneTransform(HumanBodyBones.Chest),
|
||||
animator.GetBoneTransform(shoulder),
|
||||
animator.GetBoneTransform(upperArm),
|
||||
animator.GetBoneTransform(lowerArm),
|
||||
animator.GetBoneTransform(hand),
|
||||
animator.transform
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
public struct AvatarTransforms
|
||||
{
|
||||
public Transform root;
|
||||
public Transform hips;
|
||||
public Transform spine;
|
||||
public Transform chest;
|
||||
public Transform neck;
|
||||
public Transform head;
|
||||
public Transform leftShoulder;
|
||||
public Transform leftUpperArm;
|
||||
public Transform leftLowerArm;
|
||||
public Transform leftHand;
|
||||
public Transform rightShoulder;
|
||||
public Transform rightUpperArm;
|
||||
public Transform rightLowerArm;
|
||||
public Transform rightHand;
|
||||
public Transform leftUpperLeg;
|
||||
public Transform leftLowerLeg;
|
||||
public Transform leftFoot;
|
||||
public Transform rightUpperLeg;
|
||||
public Transform rightLowerLeg;
|
||||
public Transform rightFoot;
|
||||
|
||||
public AvatarTransforms GetAvatarTransforms(Animator animator)
|
||||
{
|
||||
AvatarTransforms result = new AvatarTransforms()
|
||||
{
|
||||
root = animator.transform,
|
||||
hips = animator.GetBoneTransform(HumanBodyBones.Hips),
|
||||
spine = animator.GetBoneTransform(HumanBodyBones.Spine),
|
||||
chest = animator.GetBoneTransform(HumanBodyBones.Chest),
|
||||
neck = animator.GetBoneTransform(HumanBodyBones.Neck),
|
||||
head = animator.GetBoneTransform(HumanBodyBones.Head),
|
||||
leftShoulder = animator.GetBoneTransform(HumanBodyBones.LeftShoulder),
|
||||
leftUpperArm = animator.GetBoneTransform(HumanBodyBones.LeftUpperArm),
|
||||
leftLowerArm = animator.GetBoneTransform(HumanBodyBones.LeftLowerArm),
|
||||
leftHand = animator.GetBoneTransform(HumanBodyBones.LeftHand),
|
||||
rightShoulder = animator.GetBoneTransform(HumanBodyBones.RightShoulder),
|
||||
rightUpperArm = animator.GetBoneTransform(HumanBodyBones.RightUpperArm),
|
||||
rightLowerArm = animator.GetBoneTransform(HumanBodyBones.RightLowerArm),
|
||||
rightHand = animator.GetBoneTransform(HumanBodyBones.RightHand),
|
||||
leftUpperLeg = animator.GetBoneTransform(HumanBodyBones.LeftUpperLeg),
|
||||
leftLowerLeg = animator.GetBoneTransform(HumanBodyBones.LeftLowerLeg),
|
||||
leftFoot = animator.GetBoneTransform(HumanBodyBones.LeftFoot),
|
||||
rightUpperLeg = animator.GetBoneTransform(HumanBodyBones.RightUpperLeg),
|
||||
rightLowerLeg = animator.GetBoneTransform(HumanBodyBones.RightLowerLeg),
|
||||
rightFoot = animator.GetBoneTransform(HumanBodyBones.RightFoot),
|
||||
};
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
175
.Deprecated/InteractionTest/ColliderTest/AvatarColliders.cs
Normal file
175
.Deprecated/InteractionTest/ColliderTest/AvatarColliders.cs
Normal file
|
@ -0,0 +1,175 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class AvatarColliders : MonoBehaviour
|
||||
{
|
||||
public Animator animator;
|
||||
public AvatarTransforms m_avatarTransforms;
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (animator == null)
|
||||
animator = GetComponent<Animator>();
|
||||
|
||||
m_avatarTransforms = m_avatarTransforms.GetAvatarTransforms(animator);
|
||||
|
||||
CreateColliderTorso();
|
||||
CreateColliderLeftArm();
|
||||
CreateColliderRightArm();
|
||||
}
|
||||
|
||||
void CreateColliderLeftArm()
|
||||
{
|
||||
// Calculate the magnitudes for the upper arm, lower arm, and hand.
|
||||
// This would need to be adjusted based on the specific avatar model being used.
|
||||
float upperArmMagnitude = CalculateMagnitude(m_avatarTransforms.leftUpperArm.position, m_avatarTransforms.leftLowerArm.position);
|
||||
//float lowerArmMagnitude = CalculateMagnitude(m_avatarTransforms.leftLowerArm.position, m_avatarTransforms.leftHand.position);
|
||||
|
||||
float handMagnitude = upperArmMagnitude * 0.25f; // Assuming hand is about half the size of the upper arm.
|
||||
|
||||
// Create a collider for the upper arm area
|
||||
Vector3 upperArmPosition = m_avatarTransforms.leftUpperArm.position;
|
||||
Vector3 lowerArmPosition = m_avatarTransforms.leftLowerArm.position;
|
||||
CreateCollider(m_avatarTransforms.leftUpperArm, upperArmPosition, lowerArmPosition, handMagnitude, 0.15f);
|
||||
|
||||
// Create a collider for the lower arm area
|
||||
Vector3 handPosition = m_avatarTransforms.leftHand.position;
|
||||
CreateCollider(m_avatarTransforms.leftLowerArm, lowerArmPosition, handPosition, handMagnitude, 0.15f);
|
||||
|
||||
// Create a collider for the hand area
|
||||
// For simplicity, let's assume the end position is slightly offset from the hand position.
|
||||
Vector3 handEndPosition = handPosition + (handPosition - lowerArmPosition) * 0.5f;
|
||||
CreateCollider(m_avatarTransforms.leftHand, handPosition, handEndPosition, handMagnitude, 0.15f);
|
||||
}
|
||||
|
||||
void CreateColliderRightArm()
|
||||
{
|
||||
// Calculate the magnitudes for the upper arm, lower arm, and hand.
|
||||
// This would need to be adjusted based on the specific avatar model being used.
|
||||
float upperArmMagnitude = CalculateMagnitude(m_avatarTransforms.rightUpperArm.position, m_avatarTransforms.rightLowerArm.position);
|
||||
//float lowerArmMagnitude = CalculateMagnitude(m_avatarTransforms.rightLowerArm.position, m_avatarTransforms.rightHand.position);
|
||||
|
||||
float handMagnitude = upperArmMagnitude * 0.25f; // Assuming hand is about half the size of the upper arm.
|
||||
|
||||
// Create a collider for the upper arm area
|
||||
Vector3 upperArmPosition = m_avatarTransforms.rightUpperArm.position;
|
||||
Vector3 lowerArmPosition = m_avatarTransforms.rightLowerArm.position;
|
||||
CreateCollider(m_avatarTransforms.rightUpperArm, upperArmPosition, lowerArmPosition, handMagnitude, 0.15f);
|
||||
|
||||
// Create a collider for the lower arm area
|
||||
Vector3 handPosition = m_avatarTransforms.rightHand.position;
|
||||
CreateCollider(m_avatarTransforms.rightLowerArm, lowerArmPosition, handPosition, handMagnitude, 0.15f);
|
||||
|
||||
// Create a collider for the hand area
|
||||
// For simplicity, let's assume the end position is slightly offset from the hand position.
|
||||
Vector3 handEndPosition = handPosition + (handPosition - lowerArmPosition) * 0.5f;
|
||||
CreateCollider(m_avatarTransforms.rightHand, handPosition, handEndPosition, handMagnitude, 0.15f);
|
||||
}
|
||||
|
||||
void CreateColliderTorso()
|
||||
{
|
||||
float legMagnitude = CalculateMagnitude(m_avatarTransforms.rightUpperLeg.position, m_avatarTransforms.leftUpperLeg.position);
|
||||
|
||||
//gets between upperarm and shoulder distances
|
||||
float armMagnitude = CalculateMagnitude(m_avatarTransforms.rightUpperArm.position, m_avatarTransforms.leftShoulder.position);
|
||||
|
||||
Vector3 hipsPosition = GetHipsPosition();
|
||||
|
||||
// Create a collider for the hips area
|
||||
Vector3 spinePosition = m_avatarTransforms.spine.position;
|
||||
CreateCollider(m_avatarTransforms.hips, hipsPosition, spinePosition, legMagnitude, 0.15f);
|
||||
|
||||
// Create a collider for the chest area
|
||||
Vector3 chestPosition = m_avatarTransforms.chest.position;
|
||||
CreateCollider(m_avatarTransforms.spine, spinePosition, chestPosition, (legMagnitude + armMagnitude) / 2, 0.15f);
|
||||
|
||||
// Create a collider for the neck area
|
||||
Vector3 neckPosition = m_avatarTransforms.neck.position;
|
||||
CreateCollider(m_avatarTransforms.chest, chestPosition, neckPosition, armMagnitude, 0.15f);
|
||||
}
|
||||
|
||||
static float CalculateMagnitude(Vector3 position1, Vector3 position2)
|
||||
{
|
||||
return (position1 - position2).magnitude;
|
||||
}
|
||||
|
||||
Vector3 GetHipsPosition()
|
||||
{
|
||||
Vector3 hipsPosition = m_avatarTransforms.hips.position;
|
||||
|
||||
if (Vector3.Distance(hipsPosition, m_avatarTransforms.root.position) < Vector3.Distance(m_avatarTransforms.head.position, m_avatarTransforms.root.position) * 0.25f)
|
||||
{
|
||||
hipsPosition = Vector3.Lerp(m_avatarTransforms.leftUpperLeg.position, m_avatarTransforms.rightUpperLeg.position, 0.5f);
|
||||
}
|
||||
|
||||
return hipsPosition;
|
||||
}
|
||||
|
||||
static void CreateCollider(Transform root, Vector3 start, Vector3 end, float width, float overlap)
|
||||
{
|
||||
Vector3 direction = end - start;
|
||||
float length = direction.magnitude * (1f + overlap);
|
||||
Vector3 axisVectorToDirection = GetAxisVectorToDirection(root.rotation, direction);
|
||||
|
||||
Vector3 lossyScale = root.lossyScale;
|
||||
float scaleF = (lossyScale.x + lossyScale.y + lossyScale.z) / 3f;
|
||||
|
||||
CapsuleCollider capsuleCollider = root.gameObject.AddComponent<CapsuleCollider>();
|
||||
capsuleCollider.height = Mathf.Abs(length / scaleF);
|
||||
capsuleCollider.radius = Mathf.Abs(width / scaleF);
|
||||
capsuleCollider.direction = DirectionVector3ToInt(axisVectorToDirection);
|
||||
capsuleCollider.center = root.InverseTransformPoint(Vector3.Lerp(start, end, 0.5f));
|
||||
capsuleCollider.isTrigger = true;
|
||||
}
|
||||
|
||||
public static Vector3 GetAxisVectorToDirection(Quaternion rotation, Vector3 direction)
|
||||
{
|
||||
direction = direction.normalized;
|
||||
Vector3 result = Vector3.right;
|
||||
|
||||
Vector3 right = rotation * Vector3.right;
|
||||
Vector3 up = rotation * Vector3.up;
|
||||
Vector3 forward = rotation * Vector3.forward;
|
||||
|
||||
float dotRight = Mathf.Abs(Vector3.Dot(Vector3.Normalize(right), direction));
|
||||
float dotUp = Mathf.Abs(Vector3.Dot(Vector3.Normalize(up), direction));
|
||||
float dotForward = Mathf.Abs(Vector3.Dot(Vector3.Normalize(forward), direction));
|
||||
|
||||
if (dotUp > dotRight)
|
||||
{
|
||||
result = Vector3.up;
|
||||
}
|
||||
|
||||
if (dotForward > dotRight && dotForward > dotUp)
|
||||
{
|
||||
result = Vector3.forward;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static int DirectionVector3ToInt(Vector3 dir)
|
||||
{
|
||||
float dotRight = Vector3.Dot(dir, Vector3.right);
|
||||
float dotUp = Vector3.Dot(dir, Vector3.up);
|
||||
float dotForward = Vector3.Dot(dir, Vector3.forward);
|
||||
|
||||
float absDotRight = Mathf.Abs(dotRight);
|
||||
float absDotUp = Mathf.Abs(dotUp);
|
||||
float absDotForward = Mathf.Abs(dotForward);
|
||||
|
||||
int result = 0;
|
||||
|
||||
if (absDotUp > absDotRight && absDotUp > absDotForward)
|
||||
{
|
||||
result = 1;
|
||||
}
|
||||
else if (absDotForward > absDotRight && absDotForward > absDotUp)
|
||||
{
|
||||
result = 2;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
30
.Deprecated/InteractionTest/ColliderTest/LineColliderTest.cs
Normal file
30
.Deprecated/InteractionTest/ColliderTest/LineColliderTest.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
using UnityEngine;
|
||||
|
||||
public static class SphereBetweenLinesHelper
|
||||
{
|
||||
public static bool IsSphereBetweenLines(Vector3 lineStart, Vector3 lineEnd, Vector3 sphereCenter, float sphereRadius)
|
||||
{
|
||||
// Calculate the closest point on the line to the sphere's center
|
||||
Vector3 closestPointOnLine = GetClosestPointOnLine(lineStart, lineEnd, sphereCenter);
|
||||
|
||||
// Calculate the distance between the sphere's center and the closest point on the line
|
||||
float distanceToLine = Vector3.Distance(sphereCenter, closestPointOnLine);
|
||||
|
||||
// Check if the sphere is between the lines
|
||||
return distanceToLine < sphereRadius;
|
||||
}
|
||||
|
||||
// Get the closest point on a line to a given point
|
||||
private static Vector3 GetClosestPointOnLine(Vector3 lineStart, Vector3 lineEnd, Vector3 point)
|
||||
{
|
||||
Vector3 lineDirection = (lineEnd - lineStart).normalized;
|
||||
float closestPointDistance = Vector3.Dot((point - lineStart), lineDirection);
|
||||
return lineStart + (closestPointDistance * lineDirection);
|
||||
}
|
||||
|
||||
public static bool IsPointWithinDistance(Vector3 position, Vector3 point, float distance)
|
||||
{
|
||||
float distanceToPosition = Vector3.Distance(position, point);
|
||||
return distanceToPosition <= distance;
|
||||
}
|
||||
}
|
40
.Deprecated/InteractionTest/GrabbableAvatar.cs
Normal file
40
.Deprecated/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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
108
.Deprecated/InteractionTest/GrabbingAvatar.cs
Normal file
108
.Deprecated/InteractionTest/GrabbingAvatar.cs
Normal file
|
@ -0,0 +1,108 @@
|
|||
using UnityEngine;
|
||||
using RootMotion.FinalIK;
|
||||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Core.Savior;
|
||||
|
||||
namespace NAK.InteractionTest;
|
||||
|
||||
internal class GrabbingAvatar : MonoBehaviour
|
||||
{
|
||||
VRIK m_vrik;
|
||||
|
||||
private bool m_isGrabbingLeft = false;
|
||||
private bool m_isGrabbingRight = false;
|
||||
|
||||
private Transform m_grabbedTransform = null;
|
||||
private Vector3 m_localOffset;
|
||||
private Quaternion m_localRotation;
|
||||
|
||||
public float m_grabRadius = 0.1f;
|
||||
public LayerMask m_grabLayerMask;
|
||||
|
||||
void Start()
|
||||
{
|
||||
m_vrik = GetComponent<VRIK>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
bool isGrabLeft = CVRInputManager.Instance.gripLeftValue >= 0.5f;
|
||||
bool isGrabRight = CVRInputManager.Instance.gripRightValue >= 0.5f;
|
||||
|
||||
if (isGrabLeft && !m_isGrabbingLeft)
|
||||
{
|
||||
m_isGrabbingLeft = true;
|
||||
OnGrab(Hand.Left);
|
||||
}
|
||||
else if (!isGrabLeft && m_isGrabbingLeft)
|
||||
{
|
||||
m_isGrabbingLeft = false;
|
||||
OnRelease(Hand.Left);
|
||||
}
|
||||
|
||||
if (isGrabRight && !m_isGrabbingRight)
|
||||
{
|
||||
m_isGrabbingRight = true;
|
||||
OnGrab(Hand.Right);
|
||||
}
|
||||
else if (!isGrabRight && m_isGrabbingRight)
|
||||
{
|
||||
m_isGrabbingRight = false;
|
||||
OnRelease(Hand.Right);
|
||||
}
|
||||
|
||||
if (m_isGrabbingLeft)
|
||||
{
|
||||
UpdateGrabbedHand(Hand.Left);
|
||||
}
|
||||
|
||||
if (m_isGrabbingRight)
|
||||
{
|
||||
UpdateGrabbedHand(Hand.Right);
|
||||
}
|
||||
}
|
||||
|
||||
void OnGrab(Hand hand)
|
||||
{
|
||||
// Find the closest grabbable object using a sphere cast
|
||||
Collider[] colliders = Physics.OverlapSphere(transform.position, m_grabRadius, m_grabLayerMask);
|
||||
if (colliders.Length > 0)
|
||||
{
|
||||
Collider closestCollider = colliders[0];
|
||||
float closestDistance = float.MaxValue;
|
||||
foreach (Collider collider in colliders)
|
||||
{
|
||||
float distance = (collider.transform.position - transform.position).magnitude;
|
||||
if (distance < closestDistance)
|
||||
{
|
||||
closestCollider = collider;
|
||||
closestDistance = distance;
|
||||
}
|
||||
}
|
||||
|
||||
// Cache the grabbed transform and local position/rotation offset
|
||||
m_grabbedTransform = closestCollider.transform;
|
||||
m_localOffset = transform.InverseTransformVector(m_grabbedTransform.position - transform.position);
|
||||
m_localRotation = Quaternion.Inverse(transform.rotation) * m_grabbedTransform.rotation;
|
||||
}
|
||||
}
|
||||
|
||||
void OnRelease(Hand hand)
|
||||
{
|
||||
// Reset the grabbed transform and local position/rotation offset
|
||||
m_grabbedTransform = null;
|
||||
m_localOffset = Vector3.zero;
|
||||
m_localRotation = Quaternion.identity;
|
||||
}
|
||||
|
||||
void UpdateGrabbedHand(Hand hand)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public enum Hand
|
||||
{
|
||||
Left,
|
||||
Right
|
||||
}
|
24
.Deprecated/InteractionTest/HarmonyPatches.cs
Normal file
24
.Deprecated/InteractionTest/HarmonyPatches.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using HarmonyLib;
|
||||
using ABI_RC.Core.Player;
|
||||
|
||||
namespace NAK.InteractionTest.HarmonyPatches;
|
||||
|
||||
class PuppetMasterPatches
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(PuppetMaster), nameof(PuppetMaster.AvatarInstantiated))]
|
||||
static void Postfix_PuppetMaster_SetupAvatar(ref PuppetMaster __instance)
|
||||
{
|
||||
__instance.avatarObject.AddComponent<AvatarColliders>();
|
||||
}
|
||||
}
|
||||
|
||||
class PlayerSetupPatches
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(PlayerSetup), nameof(PlayerSetup.SetupAvatar))]
|
||||
static void Postfix_PlayerSetup_SetupAvatar(ref PlayerSetup __instance)
|
||||
{
|
||||
__instance._avatar.AddComponent<AvatarColliders>();
|
||||
}
|
||||
}
|
8
.Deprecated/InteractionTest/InteractionTest.csproj
Normal file
8
.Deprecated/InteractionTest/InteractionTest.csproj
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<ItemGroup>
|
||||
<Reference Include="ml_prm">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ChilloutVR\Mods\ml_prm.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
</Project>
|
26
.Deprecated/InteractionTest/Main.cs
Normal file
26
.Deprecated/InteractionTest/Main.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using MelonLoader;
|
||||
|
||||
namespace NAK.InteractionTest;
|
||||
|
||||
public class InteractionTest : MelonMod
|
||||
{
|
||||
internal static MelonLogger.Instance Logger;
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
ApplyPatches(typeof(HarmonyPatches.PuppetMasterPatches));
|
||||
ApplyPatches(typeof(HarmonyPatches.PlayerSetupPatches));
|
||||
}
|
||||
|
||||
void ApplyPatches(Type type)
|
||||
{
|
||||
try
|
||||
{
|
||||
HarmonyInstance.PatchAll(type);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LoggerInstance.Msg($"Failed while patching {type.Name}!");
|
||||
LoggerInstance.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
30
.Deprecated/InteractionTest/Properties/AssemblyInfo.cs
Normal file
30
.Deprecated/InteractionTest/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
using MelonLoader;
|
||||
using NAK.InteractionTest.Properties;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyTitle(nameof(NAK.InteractionTest))]
|
||||
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
|
||||
[assembly: AssemblyProduct(nameof(NAK.InteractionTest))]
|
||||
|
||||
[assembly: MelonInfo(
|
||||
typeof(NAK.InteractionTest.InteractionTest),
|
||||
nameof(NAK.InteractionTest),
|
||||
AssemblyInfoParams.Version,
|
||||
AssemblyInfoParams.Author,
|
||||
downloadLink: "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/AvatarScale"
|
||||
)]
|
||||
|
||||
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
|
||||
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
||||
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
||||
[assembly: MelonAdditionalDependencies("PlayerRagdollMod")]
|
||||
|
||||
namespace NAK.InteractionTest.Properties;
|
||||
internal static class AssemblyInfoParams
|
||||
{
|
||||
public const string Version = "1.0.0";
|
||||
public const string Author = "NotAKidoS";
|
||||
}
|
16
.Deprecated/InteractionTest/README.md
Normal file
16
.Deprecated/InteractionTest/README.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
# InteractionTest
|
||||
|
||||
Makes "AvatarScale" parameter persistant across avatars.
|
||||
|
||||
Combined with AvatarScaleTool, this allows for crossa consistant scale when switching between avatars.
|
||||
|
||||
---
|
||||
|
||||
Here is the block of text where I tell you this mod is not affiliated or endorsed by ABI.
|
||||
https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games
|
||||
|
||||
> This mod is an independent creation and is not affiliated with, supported by or approved by Alpha Blend Interactive.
|
||||
|
||||
> Use of this mod is done so at the user's own risk and the creator cannot be held responsible for any issues arising from its use.
|
||||
|
||||
> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive.
|
23
.Deprecated/InteractionTest/format.json
Normal file
23
.Deprecated/InteractionTest/format.json
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"_id": 126,
|
||||
"name": "AvatarScale",
|
||||
"modversion": "1.0.5",
|
||||
"gameversion": "2022r170p1",
|
||||
"loaderversion": "0.6.1",
|
||||
"modtype": "Mod",
|
||||
"author": "NotAKidoS",
|
||||
"description": "Fixes two issues with the Avatar Advanced Settings buffers when loading remote avatars. In simple terms, it means 'fewer wardrobe malfunctions'.\n\nEmpty buffer (all 0/false) will no longer be applied on load.\nReceived AAS data is ignored until the wearer has loaded into the expected avatar.\n(The avatar will sit in its default state until the wearer has loaded and started syncing correct AAS)\nAAS will no longer be sent while switching avatar.\n\nPlease view the GitHub README for links to relevant feedback posts.",
|
||||
"searchtags": [
|
||||
"aas",
|
||||
"sync",
|
||||
"naked",
|
||||
"buffer"
|
||||
],
|
||||
"requirements": [
|
||||
"None"
|
||||
],
|
||||
"downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r3/AvatarScale.dll",
|
||||
"sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/AvatarScale/",
|
||||
"changelog": "",
|
||||
"embedcolor": "9b59b6"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue