mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
further cleanup of repo
This commit is contained in:
parent
4f8dcb0cd0
commit
323eb92f2e
140 changed files with 1 additions and 2430 deletions
|
@ -0,0 +1,39 @@
|
|||
using ABI.CCK.Components;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.AvatarCloneTest;
|
||||
|
||||
public class AvatarCloneExclusion : IExclusionBehaviour
|
||||
{
|
||||
public readonly Dictionary<SkinnedMeshRenderer, List<int>> skinnedToBoneIndex = new();
|
||||
public readonly List<Transform> affectedTransforms = new();
|
||||
public readonly List<Renderer> affectedRenderers = new();
|
||||
public HashSet<Transform> affectedTransformSet = new();
|
||||
|
||||
private readonly AvatarClone _cloneSystem;
|
||||
private readonly Transform _target;
|
||||
internal Transform _shrinkBone;
|
||||
|
||||
public bool isImmuneToGlobalState { get; set; }
|
||||
|
||||
public AvatarCloneExclusion(AvatarClone cloneSystem, Transform target)
|
||||
{
|
||||
_cloneSystem = cloneSystem;
|
||||
_target = target;
|
||||
}
|
||||
|
||||
public void UpdateExclusions(bool isShown, bool shrinkToZero)
|
||||
{
|
||||
if (_shrinkBone == null)
|
||||
{
|
||||
// Create shrink bone parented directly to target
|
||||
_shrinkBone = new GameObject($"{_target.name}_Shrink").transform;
|
||||
_shrinkBone.SetParent(_target, false);
|
||||
}
|
||||
// Set scale based on shrink mode
|
||||
_shrinkBone.localScale = shrinkToZero ? Vector3.zero : Vector3.positiveInfinity;
|
||||
|
||||
// Replace the bone references with the shrink bone for the indicies we modify
|
||||
_cloneSystem.HandleExclusionUpdate(this, isShown);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue