AvatarCloneTest: push so i can reference in an email

This commit is contained in:
NotAKidoS 2025-01-29 16:37:15 -06:00
parent 6d30fe1f41
commit 3660b8f683
16 changed files with 1155 additions and 0 deletions

View file

@ -0,0 +1,34 @@
using MagicaCloth;
using MagicaCloth2;
using UnityEngine;
namespace NAK.AvatarCloneTest;
public partial class AvatarClone
{
#region Magica Cloth Support
private void SetupMagicaClothSupport()
{
var magicaCloths1 = GetComponentsInChildren<MagicaRenderDeformer>(true);
foreach (MagicaRenderDeformer magicaCloth in magicaCloths1)
{
// Get the renderer on the same object
Renderer renderer = magicaCloth.gameObject.GetComponent<Renderer>();
SetRendererNeedsAdditionalChecks(renderer, true);
}
var magicaCloths2 = GetComponentsInChildren<MagicaCloth2.MagicaCloth>(true);
foreach (MagicaCloth2.MagicaCloth magicaCloth in magicaCloths2)
{
if (magicaCloth.serializeData.clothType != ClothProcess.ClothType.MeshCloth)
continue; // Only matters for cloth physics
// Set the affected renderers as requiring extra checks
var renderers = magicaCloth.serializeData.sourceRenderers;
foreach (Renderer renderer in renderers) SetRendererNeedsAdditionalChecks(renderer, true);
}
}
#endregion Magica Cloth Support
}