mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
AvatarCloneTest: push so i can reference in an email
This commit is contained in:
parent
6d30fe1f41
commit
3660b8f683
16 changed files with 1155 additions and 0 deletions
34
AvatarCloneTest/AvatarClone/AvatarClone.MagicaSupport.cs
Normal file
34
AvatarCloneTest/AvatarClone/AvatarClone.MagicaSupport.cs
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue